• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get attachments from soap response

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which client side API are you using?
 
siva battula
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check out http://www.mkyong.com/java/sax-error-content-is-not-allowed-in-prolog/
 
siva battula
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks
Ulf Dittmer & Maneesh for your help.i was able to get the attachment.

Thanks ,
Siva
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic