Attachment and Webservice

Hi experts,

 

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 ?

 

Thanks.

Tags:

  • Hi chubaka,

     

    Would you like to retrieve attachments from incidents tickets?

     

    I guess earlier froum discuss this thing.

     

     

    Thanks and regards,

    abhijit khewale

  • yes indeed,

     

    but none about how I can get the data back outside SM7.

     

    For example, I try to get the data from SoapUI. I put the value "true" to attachmentInfo and attachmentData in the RetrieveIncidentRequest.

    I've got his in response :

                   <attachments>
                      <cmn:attachment href="cid:id4e8dbbec002d704003656d88" len="2870" name="JS_Attach.txt" type="text/plain"/>
                   </attachments>

    Now, could you explain me which webservices should be invoke to get the data back that I can read it ?

    What is the syntax for this ?

     

    Thanks for your help

     

  • Hi C,

     

    You  are trying to get attachments from IncidentManagement wsdl thats is not possible because attachments are stored in file SYSATTACHMENTS.

     

    Incidents stores only reference id to that attachments.

     

    re,

    abhijit

  • HI,

     

    Thanks for your answer.

     

    I understood that I could not get data from this wsdl but only information about the attachment.

     

    What I try to ask is ; do I need to invoke another wsdl ? If yes, which one ? And if it is not present, should I build a custom one which can allow me to get the data back ? And what will be the parameters for it ?

     

    I try to make a new one named Attachments on SYSATTACHMENT table.

     

    I have now a new wsdl that I added in SoapUI. Even in that case, I can not get data (or binaries) of the attachment.

    I'm a bit lost now and I do not know what to do to get these files attached to an incident.

     

    Thanks all for your help

     

  • Verified Answer

    Here is the solution :

     

    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 ">"

     

     

    Hope this help someone one day.

     

    Best regards

  • Hello Chubaka,

     

    The solution is to insert attachment to a Incident via webservice. Is there any way to get the attachement from Service manager using webservice (or using Connect IT).

     

    Thanks & Regards,

    Madhava

  • Hi

     

     

     

     

     

     

  • Hi Chubaka,

    Thanks for sharing this.

    Regards,
    abhijit k