aspose file tools*
The moose likes Web Services and the fly likes Webservice that returns SOAP Attachment and payload - JAXWS Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Webservice that returns SOAP Attachment and payload - JAXWS" Watch "Webservice that returns SOAP Attachment and payload - JAXWS" New topic
Author

Webservice that returns SOAP Attachment and payload - JAXWS

Pattabhi ram
Greenhorn

Joined: May 11, 2012
Posts: 4
Hi,

Could some one help me how to create a web service that returns a SOAP response with 'an attachment as well as payload'?
I am trying to implement in JAX-WS
Sample code would do better

thanks,
raghu
Palak Mathur
Ranch Hand

Joined: Jan 29, 2007
Posts: 313

Pattabhi ram wrote:Hi,

Could some one help me how to create a web service that returns a SOAP response with 'an attachment as well as payload'?
I am trying to implement in JAX-WS
Sample code would do better

thanks,
raghu


You may want to visit the following website:-

http://www.theserverside.com/news/1363957/Sending-Attachments-with-SOAP


Palak Mathur | My Blog | TechJaunt | What is JavaRanch? | List of All FAQs
Pattabhi ram
Greenhorn

Joined: May 11, 2012
Posts: 4
Thanks for the reply!!!

My application behaves like this:

The Response from the web service is captured as raw-response string as 'urlConnection.getInputStream()'.
This response string consists of SOAP response and HTTP headers also binary data of attachment.
I am trying to find out and remove the attachment content from the retrieved response string and keep only payload content.

Please help me to find out attachment and remove the same from Response

Response:

--uuid:944d2599-2d6c-4079-84d5-4387801a51fd
Content-Id: <rootpart*944d2599-2d6c-4079-84d5-4387801a51fd@example.jaxws.sun.com>
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
Content-Transfer-Encoding: binary

<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:getImageAsAttachmentResponse xmlns:ns2="http://testAttachWs.ss7.ngin.jee.ericsson.com/"><return><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:aab671fe-3fb1-4f71-a9d7-ddcc0f32bae7@example.jaxws.sun.com"/></return></ns2:getImageAsAttachmentResponse></S:Body></S:Envelope>


--uuid:944d2599-2d6c-4079-84d5-4387801a51fd
Content-Id: <aab671fe-3fb1-4f71-a9d7-ddcc0f32bae7@example.jaxws.sun.com>
Content-Type: image/png
Content-Transfer-Encoding: binary

<<Binary data>>


--uuid:944d2599-2d6c-4079-84d5-4387801a51fd
 
jQuery in Action, 2nd edition
 
subject: Webservice that returns SOAP Attachment and payload - JAXWS