• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get attachments from soap response  RSS feed

 
siva battula
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends,could any one help me how to get attachments data from soap response having mulit-part messages as follows,
------=_Part_585_5017019.1404291979395Content-Type: text/xml; charset=utf-8
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><RetrieveIncidentResponse message="Success" returnCode="0" schemaRevisionDate="2014-07-01" schemaRevisionLevel="1" status="SUCCESS" 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" xsi:schemaLocation="http://schemas.hp.com/SM/7 http://myhostname:13080/SM/7/Incident.xsd">
<model>
<keys>
<IncidentID type="String">IM10730</IncidentID>
</keys>
<instance>
<IncidentID type="String">IM10730</IncidentID>
<Company type="String">advantage</Company>
<Title type="String">Test Incident Created for Field Mapping</Title>
<TicketOwner type="String">falcon</TicketOwner><Service type="String">MyDevices</Service>
<attachments cmn:attachment href="cid:53b0f0ef000bb185205a6268" len="50339" name="xendesktop-1412.log" type="multipart/related" xmime:contentType="multipart/related"/>
</attachments>
</instance>
</model>
</RetrieveIncidentResponse></SOAP-ENV:Body>
</SOAP-ENV:Envelope>------=_Part_585_5017019.1404291979395Content-Type: multipart/relatedContent-Location: xendesktop-1412.logContent-ID: cid:53b0f0ef000bb185205a6268Dec 14 15:28:32:317 [main, xendesktop] ****************[ Booting ]****************Dec 14 15:28:32:317 [main, xendesktop] version DONE: Inventory add components: DESKTOPGROUP {Seconds=8.050}Dec 14 16:46:30:672 [pool-1-thread-1, xendesktop] PERF: START: Inventory add components: DESKTOPDec 14 16:46:30:672 [pool-1-thread-1, xendesktop] PERF: START: Execute Powershell Script: Scripts/Desktops.txt------=_Part_585_5017019.1404291979395Content-Type: multipart/relatedContent-Location: xendesktop-1412.logContent-ID: ------=_Part_585_5017019.1404291979395--


Thanks in Advance,
BSR
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which client side API are you using?
 
siva battula
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Ulf Dittmer.I am using java SAAJ Implementation.could you please hlep is there any way i can parse this soap response and get attachments.

thanks ,
bsr
 
siva battula
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Could any one help,how can i get the attachments from soap response using SAAJ.

Thanks,
BSR
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See http://www.xyzws.com/scdjws/studyguide/saaj_print.html in the "Accessing an AttachmentPart Object " section.
 
siva battula
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Dittmer,
I tried with saaj implementation:
It is giving the below error,

please help me how to resolve this issue.
Thanks & Regards,
Siva
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) In which line of code does this happen?

2) This looks suspicious: soapPart.setContent(source); - you're processing SOAP, after all, not creating it.

3) How do you get from soapPart (which should be empty at that point, because it was just created) to soapResponse? The code you posted seems a bit out of order and incomplete.
 
siva battula
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
Ulf Dittmer & Maneesh for your help.i was able to get the attachment.

Thanks ,
Siva
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!