Here is a simple comparison between these 3 options.
- base64Binary sends the attachments as base64 inline in the SOAP message. i.e. The Attachment in embedded in the SOAP Message. Bloats the message by 33%.
- SWA sends the Attachment outside the SOAP message (The SOAP message contains a reference to the attachment). But the SOAP infoset does not contain the attachment
- MTOM Provides the best of both world. The Attachment is sent outside the SOAP message with a reference to it but the attachment appears as if it is embedded in the SOAP message (The SOAP infoset contains the attachment)
Axis2 as well as (WSO2 WSAS) supports all three of the above mechanisms. In a later post I will describe how each of the above can be used and how the actual wire messages look.
5 comments:
Does Axis2 honor the "threshold" setting for MTOM? I know that JAXWS currently doesn't honor the threshold.
What do you really mean by "threshold setting for MTOM"?
I think what Adam means is that if a binary element is less than a certain size then the overhead of using MTOM is not worth-while since you may come up with a longer message.
Another scenario where using MTOM with soap web services makes sense is that it allows large amount of data to be sent from the client (upload) or server (download). See sample code for SOAP and MTOM
Nice comparison, please also see:
http://soa-java.blogspot.nl/2012/09/mtom-email-attachment.html
Post a Comment