Highlighted
Absent Member.. mjpl Absent Member..
Absent Member..
919 views

Retrieving attachment through WSDL

Hello experts,

 

I'm trying to retrieve an attachment through web service using WSDL. I am using SoapUI to test and have created the following request to IncidentManagement.wsdl:

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pws="http://servicecenter.peregrine.com/PWS" xmlns:com="http://servicecenter.peregrine.com/PWS/Common">
 <soapenv:Header/>
 <soapenv:Body>
 <pws:RetrieveIncidentRequest attachmentInfo="1" attachmentData="1" ignoreEmptyElements="true">
 <pws:model>
 <pws:keys>
 <pws:IncidentID></pws:IncidentID>
 </pws:keys>
 <pws:instance>
 <pws:IncidentID>IM829376</pws:IncidentID>
 <pws:attachments>
 <com:attachment href="" contentId="" action="" name="" type="" len="" charset="" attachmentType=""/>
 </pws:attachments>
 </pws:instance>
 <pws:messages>
 <com:message type="String" mandatory="" readonly="" severity="" module=""></com:message>
 </pws:messages>
 </pws:model>
 </pws:RetrieveIncidentRequest>
 </soapenv:Body>
</soapenv:Envelope>

 

I'm getting a response in return that contains the following:

 

<attachments hasuploadby="true" hasuploaddate="true">
                  <cmn:attachment href="cid:540823c30011100d50b25af8" isNew="false" len="15" name="SD1462732_testatt.txt" type="text/plain" upload.by="support_01" upload.date="04/09/14 10:33:07" xmime:contentType="text/plain"/>
               </attachments>

 

But SoapUI does not show anything in the attachments section. I've tried forcing MTOM and playing around with SoapUI options thinking it might be the tool's fault and not HPSM's, but to no avail. if MTOM is forced, the response contains:

 

               <attachments hasuploadby="true" hasuploaddate="true">
                  <cmn:attachment href="cid:540823c30011100d50b25af8" isNew="false" len="15" name="SD1462732_testatt.txt" type="text/plain" upload.by="support_01" upload.date="04/09/14 10:33:07" xmime:contentType="text/plain">
                     <xop:Include href="cid:540823c30011100d50b25af8" xmlns:xop="http://www.w3.org/2004/08/xop/include"/>
                  </cmn:attachment>
               </attachments>

 

But still no attachment. Having followed I think all of the threads that deal with attachments and WSDL on this forum, I also tried making a request to sysattachment WSDL (InteractionAttachment.wsdl) with the following (InteractionId is maped to topic field and UID to uid, I used the href value from the response to RetrieveIncidentRequest)

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://schemas.hp.com/SM/7" xmlns:com="http://schemas.hp.com/SM/7/Common" xmlns:xm="http://www.w3.org/2005/05/xmlmime">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:RetrieveInteractionAttachmentRequest attachmentInfo="1" attachmentData="1" ignoreEmptyElements="true">
         <ns:model>
            <ns:keys>
            </ns:keys>
            <ns:instance>
            	<ns:InteractionId type="String">IM829376</ns:InteractionId>
               <ns:UID type="String">540823c30011100d50b25af8</ns:UID>
               <ns:attachments>
                  <com:attachment href="" contentId="" action="" name="" type="" len="" charset="" attachmentType=""/>
               </ns:attachments>
            </ns:instance>
            <!--Optional:-->
            <ns:messages>
               <!--Zero or more repetitions:-->
               <com:message type="String"></com:message>
            </ns:messages>
         </ns:model>
      </ns:RetrieveInteractionAttachmentRequest>
   </soapenv:Body>
</soapenv:Envelope>

 But the response also does not contain any attachments, only the following:

 

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <RetrieveInteractionAttachmentResponse message="Success" returnCode="0" schemaRevisionDate="2014-04-08" schemaRevisionLevel="0" status="SUCCESS" xsi:schemaLocation="http://schemas.hp.com/SM/7 http://srv:13083/SM/7/InteractionAttachment.xsd" xmlns="http://schemas.hp.com/SM/7" xmlns:cmn="http://schemas.hp.com/SM/7/Common" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
         <model>
            <keys>
               <application type="String">probsummary</application>
               <InteractionId type="String">IM829376</InteractionId>
               <type type="Decimal">5</type>
               <segment type="Decimal">0</segment>
               <UID type="String">540823c30011100d50b25af8</UID>
            </keys>
            <instance recordid="probsummary - IM829376 - 5 - 0 - 540823c30011100d50b25af8" uniquequery="application=&quot;probsummary&quot; and topic=&quot;IM829376&quot; and type=5 and segment=0 and uid=&quot;540823c30011100d50b25af8&quot;">
               <InteractionId type="String">IM829376</InteractionId>
               <UID type="String">540823c30011100d50b25af8</UID>
               <attachments hasuploadby="true" hasuploaddate="true"/>
            </instance>
         </model>
      </RetrieveInteractionAttachmentResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

I'm a bit confused here, I don't know if I'm doing something wrong, is HPSM misbehaving or maybe my SoapUI configuration is wrong? Has anyone managed to get the attachment data in SoapUI?

 

Best regards,

mjpl

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.