File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes SOAP with Attachments (SwA) with Axis2, problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "SOAP with Attachments (SwA) with Axis2, problem." Watch "SOAP with Attachments (SwA) with Axis2, problem." New topic

SOAP with Attachments (SwA) with Axis2, problem.

P Chaudhari

Joined: Mar 22, 2004
Posts: 22
Hi All,

My client is having axis1.x SOAP client, who sends a file, for which I am suppose to write a Webservice. I have decided to use axis 2.0 for this service.

To get my axis 1.x SOAP client running with axis 2 SOAP Service, I was using following tutorial.

It says.

"Axis2 Handles SwA messages at the inflow only. When Axis2 receives a SwA message it extracts the binary attachment parts and puts a reference to those parts in the Message Context."

I understood this as following, if I send the SOAP message with attachment using axis1.x client to the axis2 webservice. Axis2 will extract the binary attachment and put an element into the xml like

<source href="cid:3936AE19FBED55AE4620B81C73BDD76E" xmlns="/>

and I can retrive this attachment from MessageContext.

But it does not work. The OMElement which I receive as a parameter to my serviceMethod do not have this source element into it. If I use following code given in tutorial.

public OMElement echoAttachment(OMElement omEle) {
OMElement child = (OMElement) omEle.getFirstOMChild(); or OMElement child = element.getFirstChildWithName(new QName("source"));
OMAttribute attr =
child.getAttribute(new QName("href"));
String contentID = attr.getAttributeValue();

Child element is always null(in case of both statements from the code snippet)

Can somebody help me here. Tutorial says above code has been tested with axis1.x can somebody send me the test client in axis 1.x.

Thanks in advance.
I agree. Here's the link:
subject: SOAP with Attachments (SwA) with Axis2, problem.
It's not a secret anymore!