File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes XML and SOAP Attachment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML and SOAP Attachment" Watch "XML and SOAP Attachment" New topic

XML and SOAP Attachment

sharad verma

Joined: Mar 14, 2002
Posts: 11

I need help with SOAP Attachment.

I'm receiving an XML message over HTTP (in a java Servlet). The incoming XML contains a SOAP message with attachment. There is no web service involved. I want to extract the SOAP attachment from the request. How can I do it?


Balaji Loganathan
author and deputy

Joined: Jul 13, 2001
Posts: 3150
I moving this XML forum as this involves XML parsing.
Randall Julian

Joined: Nov 21, 2004
Posts: 14
Detaching an attachment from a SOAP message depends on what format the attachment is in. If it came from a Microsoft source (like MSXML) then it is most likely DIME and you need a DIME parser to deal with it. Something like onion networks: Onion Networks Web Page.

If it comes from a Java-based source then there are several things you can do. Most people seem to be using Axis for this kind of thing - check out:

Loughran paper on SwA

He's got some example code which 'manually' extracts attachments.
It is sorta covered in the JavaRanch Style Guide.
subject: XML and SOAP Attachment