
What I need to know is how to send the attached file through the web services, I will need to put the file address inside the WSDL?
See bellow what I triad to do and didn't work: <urn:z2AF_Act_Attachment_1_attachmentName>C:\Documents and Settings\All Users\Application Data\AR System\home\ar.ini</urn:z2AF_Act_Attachment_1_attachmentName> <urn:z2AF_Act_Attachment_1_attachmentOrigSize>6656</urn:z2AF_Act_Attachment_1_attachmentOrigSize> <urn:z2AF_Act_Attachment_1_attachmentData>cid:705319490899</urn:z2AF_Act_Attachment_1_attachmentData> Thanks, Claudia Ferro
Hi Claudia,
I did a proof of concept test with web service attachments a while ago (although I did not get to implement it in production).
Basically, you need to encode your attachment into base64 encoded string.
I produced a short document, which has the the details of my test. Since I can't find a way to attach it, I'll try paste the contents into this post.
I hope you find this of some use.
Kind regards,
Joel Guttenberg
----------------------------------------------------------------------------------
ARS WEB SERVICE ATTACHMENTS
This document shows how ARS accepts attachments via web services by way of example.
A test form with an attachment field was created, and then exposed via web services.
The web service allows a consumer to create a record in the test attachment form that has a file in the attachment field.
A requirement of the ARS web service attachment function is that the file is converted into a base64 encoded string.
For the purposes of the test, an online converter was used to provide the conversion function (as this was not part of our test tool’s capabilties).
For reference, the online converter tool can be found at:
http://www.motobit.com/util/base64-decoder-encoder.asp
The test file is simple text file:
We used the Crosscheck Soap Sonar tool to test the web service.
The XML to create the attachment appears as follows:
(Note the encoded string in the attachmentData tag.)
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:s0="urn:TestWebServiceAttachment">
<soap:Header>
<s0:AuthenticationInfo>
<s0:userName>Demo</s0:userName>
<s0:password/>
</s0:AuthenticationInfo>
</soap:Header>
<soap:Body>
<s0:OpCreate>
<s0:Assigned_To/>
<s0:Attachment_attachmentName>Test.txt</s0:Attachment_attachmentName>
<s0:Attachment_attachmentData>VGhpcyBpcyBhIHRlc3QgdGV4dCBmaWxlLCBMaW5lIDAxLg0KVGhpcyBpcyBhIHRlc3QgdGV4dCBmaWxlLCBMaW5lIDAyLg0KVGhpcyBpcyBhIHRlc3QgdGV4dCBmaWxlLCBMaW5lIDAzLg0KVGhpcyBpcyBhIHRlc3QgdGV4dCBmaWxlLCBMaW5lIDA0Lg0KVGhpcyBpcyBhIHRlc3QgdGV4dCBmaWxlLCBMaW5lIDA1Lg0KVGhpcyBpcyBhIHRlc3QgdGV4dCBmaWxlLCBMaW5lIDA2Lg0KVGhpcyBpcyBhIHRlc3QgdGV4dCBmaWxlLCBMaW5lIDA4Lg0KVGhpcyBpcyBhIHRlc3QgdGV4dCBmaWxlLCBMaW5lIDA5Lg0KVGhpcyBpcyBhIHRlc3QgdGV4dCBmaWxlLCBMaW5lIDEwLg0KVGhpcyBpcyBhIHRlc3QgdGV4dCBmaWxlLCBMaW5lIDExLg==</s0:Attachment_attachmentData>
<s0:Attachment_attachmentOrigSize>358</s0:Attachment_attachmentOrigSize>
<s0:Field_One>Value1</s0:Field_One>
<s0:Field_Three>Value2</s0:Field_Three>
<s0:Field_Two>Value3</s0:Field_Two>
<s0:Short_Description>Test</s0:Short_Description>
<s0:Status>New</s0:Status>
<s0:Submitter>Demo</s0:Submitter>
</s0:OpCreate>
</soap:Body>
</soap:Envelope>
The XML response from the ARS web service appears as follows:
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:OpCreateResponse xmlns="urn:TestWebServiceAttachment" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns1="urn:TestWebServiceAttachment">
<ns1:Request_ID>000000000000008</ns1:Request_ID>
</ns1:OpCreateResponse>
</soapenv:Body>
</soapenv:Envelope>
A screenshot of the new record in the ARS client tool is shown below:
A screenshot of the ARS web service definition for the test attachment form.
Below are screenshots of the online base 64 encoding tool:
Encoded string in online tool:
Message was edited by: Mark
..............................del...................
Message was edited by: Mark