MTOM
Encyclopedia
MTOM is the W3C
Message Transmission Optimization Mechanism,
a method of efficiently sending binary data to and from Web service
s.
MTOM is usually used with XOP (XML-binary Optimized Packaging).
In the lead up to the approval of MTOM as a W3C Recommendation, several different alternatives for handling binary data in SOAP
messages were submitted to the W3C: SOAP with Attachments
(SwA) and DIME
attachments. MTOM supersedes those other proposals.
uses XML, any binary data in the SOAP message will have to be encoded as text. This is usually done using Base64
encoding which increases the size of the binary data by 33%. MTOM provides a way to send the binary data in its original binary form, avoiding any increase in size due to encoding it in text. MTOM does not address the efficiency of serializing or deserializing the messages.
The use of MTOM is a hop-by-hop contract between one SOAP node and the next. There is no guarantee that the optimization will be preserved if there are multiple SOAP nodes involved.
Sometimes the term "MTOM" is used as a shorthand to mean "MTOM with XOP". XOP is used as the referencing mechanism in the serialised XML infoset. In theory, the abstract MTOM model could be used with a different referencing mechanism or different container format. In theory, MTOM could be used over a different transport protocol instead of HTTP. In practice, MTOM is usually used with XOP, MIME and HTTP.
World Wide Web Consortium
The World Wide Web Consortium is the main international standards organization for the World Wide Web .Founded and headed by Tim Berners-Lee, the consortium is made up of member organizations which maintain full-time staff for the purpose of working together in the development of standards for the...
Message Transmission Optimization Mechanism,
a method of efficiently sending binary data to and from Web service
Web service
A Web service is a method of communication between two electronic devices over the web.The W3C defines a "Web service" as "a software system designed to support interoperable machine-to-machine interaction over a network". It has an interface described in a machine-processable format...
s.
MTOM is usually used with XOP (XML-binary Optimized Packaging).
Status
MTOM is a W3C Recommendation.In the lead up to the approval of MTOM as a W3C Recommendation, several different alternatives for handling binary data in SOAP
SOAP
SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks...
messages were submitted to the W3C: SOAP with Attachments
SOAP with Attachments
SOAP with Attachments or MIME for Web Services refers to the method of using Web Services to send and receive files using a combination of SOAP and MIME, primarily over HTTP....
(SwA) and DIME
Direct Internet Message Encapsulation
Direct Internet Message Encapsulation was a Microsoft-proposed internet standard in the early 2000s for the streaming of binary and other encapsulated data over the Internet....
attachments. MTOM supersedes those other proposals.
Benefits
The efficiency claims of MTOM only refers to the size of the messages sent across the wire. Since SOAPSOAP
SOAP, originally defined as Simple Object Access Protocol, is a protocol specification for exchanging structured information in the implementation of Web Services in computer networks...
uses XML, any binary data in the SOAP message will have to be encoded as text. This is usually done using Base64
Base64
Base64 is a group of similar encoding schemes that represent binary data in an ASCII string format by translating it into a radix-64 representation...
encoding which increases the size of the binary data by 33%. MTOM provides a way to send the binary data in its original binary form, avoiding any increase in size due to encoding it in text. MTOM does not address the efficiency of serializing or deserializing the messages.
Application
MTOM only optimizes element content that is in the canonical lexical representation of the xs:base64Binary data type. Since there is no standard way to indicate whether data is in the canonical lexical representation, the mechanism for applying MTOM is implementation dependent.The use of MTOM is a hop-by-hop contract between one SOAP node and the next. There is no guarantee that the optimization will be preserved if there are multiple SOAP nodes involved.
Details
Although most users treat MTOM as a single mechanism, the MTOM specification defines it as three related features:- Firstly, an "Abstract SOAP Transmission Optimization Feature" for sending and receiving SOAP messages that contain binary data. The binary data is a part of the single XML Infoset model, but this feature introduces the concept of sending the binary data separately (i.e. not in the serialized XML infoset). This abstract feature does not define how the serialized XML infoset looks without the binary data, nor how the binary data is actually represented.
- Secondly, an "Optimized MIME Multipart/Related Serialization of SOAP Messages" is defined. This defines that the serialized XML infoset will include XML-binary Optimized Packaging (XOP) in place of the binary data, and the binary data (along with the serialized XML infoset with XOP placeholders) will be represented together in a MIMEMIMEMultipurpose Internet Mail Extensions is an Internet standard that extends the format of email to support:* Text in character sets other than ASCII* Non-text attachments* Message bodies with multiple parts...
container. Although this defines a SOAP message, it does not define the transport protocol over which that MIME and XOP SOAP message is sent. - Thirdly, a "HTTP SOAP Transmission Optimization Feature" defines how the above MIME and XOP SOAP message is sent over HTTP.
Sometimes the term "MTOM" is used as a shorthand to mean "MTOM with XOP". XOP is used as the referencing mechanism in the serialised XML infoset. In theory, the abstract MTOM model could be used with a different referencing mechanism or different container format. In theory, MTOM could be used over a different transport protocol instead of HTTP. In practice, MTOM is usually used with XOP, MIME and HTTP.