aspose file tools*
The moose likes Web Services and the fly likes Axis SOAP Web Service with Attachments Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis SOAP Web Service with Attachments" Watch "Axis SOAP Web Service with Attachments" New topic
Author

Axis SOAP Web Service with Attachments

Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
In order to build a web service that sends SOAP messages with binary MIME attachments, is there support for this in the generated Axis stub objects or in the JAX-RPC API? Right now we can only approach this by "hand-crafting" the SOAP message from scratch. Is this statement correct?

Any guidance would be greatly appreciated. Thanks.
dharmendra gahlot
Ranch Hand

Joined: Apr 22, 2009
Posts: 54
Tere are two options with Axis2, from which you can choose one.
1. MTOM (SOAP Message Transmission Optimization Mechanism)
2. SwA (SOAP Messages with Attachments)

Apache Axis2 exposes the attachment handling functionality through the MessageContext API. You can attach, access, or remove attachments belonging to a message using the org.apache.axis2.context.MessageContext in this API. Alternatively, you can also get a reference to the attachment map to directly manipulate the attachments.


Dharmendra Gahlot
SCJP-5.0 87%,SCWCD-5.0 92%
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42608
    
  65
Don't use JAX-RPC for anything; it's obsolete.


Ping & DNS - my free Android networking tools app
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Thanks.

You can attach, access, or remove attachments belonging to a message using the org.apache.axis2.context.MessageContext in this API. Alternatively, you can also get a reference to the attachment map to directly manipulate the attachments.


Can I get to the MessageContext from the service's implementation object, e.g. MyServiceSoapBindingImpl?

Or, is the only way to touch the SOAP message is to "hand-write" it with the javax.xml.soap package?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Axis SOAP Web Service with Attachments