-
1. Re: Remedy Web Services development doubts
Joel Guttenberg Sep 1, 2009 1:46 AM (in response to Claudia Ferro)1 of 1 people found this helpfulHi 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.aspThe 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:
-
2. Re: Remedy Web Services development doubts
Mark NameToUpdate Sep 21, 2009 9:56 PM (in response to Claudia Ferro)Message was edited by: Mark
..............................del...................
| Generic Xanax online | buy vicodin online | generic viagra online cheap | buy generic valium | Buy Ultram online | Buy Tramadol online | Buy Tamiflu online | Buy Phentermine online | buy MERIDIA online | buy lorazepam online | buy generic fioricet online | buy ATIVAN online | Buy AMBIEN online | buy adipex online | buy hydrocodon online | order generic cialis | buy levitra online | order Viagra online | order cheap sildenafil | order tadalafil online | buy vardenafil online | order lexapro online | buy abilify online | buy zyprexa online | buy soma online |Message was edited by: Mark
-
3. Re: Remedy Web Services development doubts
Anil Varanasi Jun 17, 2010 2:11 PM (in response to Claudia Ferro)Thanks a lot that was very helpful.
-
4. Re: Remedy Web Services development doubts
Ankit Tiwari May 16, 2018 7:38 AM (in response to Joel Guttenberg)Hi Joel,
Thank you for you post. I tried in similar way and it worked fine.
My query is If I want to test using a file as attachment instead of specifying direct data in WSDL file. For ex. you specified base64 string under tag <s0:Attachment_attachmentData>VGhpcyBpcyBhIHRlc3QgdGV4dCBmaWxlLCBMaW5lIDAxLg0KVGhpcyBpcyBhIHR.... >
Now, If I want to upload attachment file in Attachment tab and test using SOAP UI then how we will achieve that ? Should we encode attachment file in base64.bin file and upload it under Attachment tab in SOAPUI or is there any other way to do it ?
I'm referring to attachment test specified in below link:
SOAP Attachments and Files | SoapUI
Regards,
Ankit
More Like This
Incoming Links
- Re: How to validate an attachment (base 64 binary) in a web service
- Attachment testing using SOAPUI
- Re: Sending attachment using HPD_IncidentInterface_Create_WS
- Re: Attachments integration between Service now and Remedy
- Re: Receive attach file via Web services.
- Re: Problem in sending attachment files to client system through Web service