This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 39578
    
  27
Don't use JAX-RPC for anything; it's obsolete.


Ping & DNS - updated with new look and Ping home screen widget
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis SOAP Web Service with Attachments
 
Similar Threads
Guide me for a SOAP attachment Tutorial.
Java2WSDL and SOAP attachments
Web Service Creation With AttachMent
File Attachment with WSDL2Java objects
Adding attachments to web service response