MTOM is a method of efficiently sending binary data to and from web services. It uses XOP (XML-binary Optimized Packaging) to transmit binary data and is intended to replace both MIME and DIME attachments. Binary content often has to be encoded to be sent as text data with SOAP messages. MTOM allows more efficient sending of binary data in a SOAP request or response.
The Figure below shows the steps involved in transmitting data between a Consumer and Producer using MTOM.

The Consumer application begins by sending a SOAP Message that contains complex data in Base64Binary encoded format. Base64Binary data type represents arbitrary data (e.g., Images, PDF files, Word Docs) in 65 textual characters that can be displayed as part of a SOAP Message element.
Step 1 in the Figure above, a sample SOAP Body with Base64Binary encoded is going to be transfered.
Step 2 of the Figure above shown in results in replacing the Base64Binary data with an
The raw binary data along with the SOAP Message and the MIME Boundary is transmitted over the wire to the Producer(Step 3). The Producer then changes the raw binary data back to Base64Binary (Step 4)encoding for further processing.
With this conversion between Base64Binary and raw binary MIME types, MTOM provides one significant advantage:
Efficient Transmission: Base64Binary encoded data is 33% larger than raw byte transmission using MIME. MTOM therefore reduces data bloat by converting Base64Binary encoding to raw bytes for transmission.
2)SOAP Message with Attachment (SwA)
SwA has been developed as a way to package SOAP messages with attachments, but will be replaced by the more powerful MTOM/XOP mechanisms.
SwA is not a new specification, but rather a mechanism for using the existing SOAP and MIME facilities to perform the transmission of files using Web Services invocations.
The message structure of SwA is as follows:
没有评论:
发表评论