• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Webservice that returns SOAP Attachment and payload - JAXWS

 
Pattabhi ram
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 328
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Pattabhi ram
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic