Attachment and Webservice

by Community Manager on ‎02-16-2012 08:13 AM

Question

 

Working on SM7.02.

 

How could I get back information about attachment with the "RetrieveIncident" webservice ? (trying with SoapUI or with my website). I do not know JS.... :-(

 

Is it possible to get the attachment back using webservice out of SM7 ?

Answer

 

Solution in SoapUI for creating :

 

<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:CreateIncidentRequest attachmentInfo="true" attachmentData="true" ignoreEmptyElements="true">
         <pws:model>
            <pws:keys>
               <pws:IncidentID></pws:IncidentID>
            </pws:keys>
            <pws:instance>
               <pws:IncidentID></pws:IncidentID>
               <pws:severity>3</pws:severity>
               <pws:InitialImpact>3</pws:InitialImpact>
               <pws:Category>International Applications</pws:Category>
               <pws:PrimaryAssignmentGroup>Administration</pws:PrimaryAssignmentGroup>
               <pws:IncidentDescription>
                  <pws:IncidentDescription>Test </pws:IncidentDescription>
               </pws:IncidentDescription>
               <pws:AssigneeName>YOURASSIGNEENAME</pws:AssigneeName>
               <pws:Contact>YOURCONTACTNAME</pws:Contact>
               <pws:BriefDescription>Test Création</pws:BriefDescription>
               <pws:Subcategory>Service Manager</pws:Subcategory>
               <pws:ProductType>User Administration</pws:ProductType>
               <pws:ProblemType>N/A</pws:ProblemType>
        <pws:attachments>
                  <com:attachment href="&lt;UserData.txt>" contentId="" action="add" name="UserData.txt" type="" len="" charset="" attachmentType=""/>
               </pws:attachments>
            </pws:instance>
            <pws:messages>
               <com:message></com:message>
            </pws:messages>
         </pws:model>
      </pws:CreateIncidentRequest>
   </soapenv:Body>
</soapenv:Envelope>

 

As you can see, careful to the attribut "com:attachment" : 

The href should start with &lt; because it the non coded html tag (Ex : href="&lt;UserData.txt>") and finish by the usual tag ">"

Search
Follow Us


Contributors
HP Blog

IT Service Management Blog

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation