There are three ways to send attachments using SOAP.
- base64Binary
- SwA - SOAP with attachments
- MTOM
base64Binary sends attachments as base64 inline in a SOAP message. those. An application embedded in a SOAP message. Increases the message by 33%.
The SWA sends the application outside the SOAP message (the SOAP message contains a link to the attachment). But SOAP information does not contain attachments.
MTOM Provides the best of the world. An attachment is sent outside the SOAP message with a link to it, but the attachment appears as if it were embedded in the SOAP message (SOAP information contains the attachment)
Due to the fact that attachments sent using MTOM appear because the attachment is part of the SOAP message, it allows you to use other WS-QOS (Quality of Service) attributes. For example, MTOM messages can be signed and encrypted using WS-Security. Thus, it provides a mechanism for sending secure applications without the need for additional specifications.
This example shows how to use MTOM with Apache AXIS2.
Prabath siriwardena
source share