Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Axis SOAP Web Service with Attachments

 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't use JAX-RPC for anything; it's obsolete.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic