2009-05-04

What is MTOM ?

MTOM is kind of message optimization for web services. The main idea is to get out binary data from SOAP message due to performance reasons. It is very similar to SOAP with Attachments (SwA) and it looks very similar to SwA.

Main rules of MTOM:
  • HTTP header must contains Content-Type header

Content-Type: multipart/related; type="text/xml"; start="START_PART";boundary="ID_of_PARTS"

  • before SOAP env. the PART ID must be given

--ID_OF_PARTS
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-Id: START_PART

  • element which contain binary data and is MTOM optimized (binary data is out of soap message) must include new element with href to part with binary data

...

--ID_OF_PARTS
Content-Type: text/plain
Content-Transfer-Encoding: binary
Content-Id:

Binary Data.....
  • after all data the end part must be given
Binary data....
--ID_OF_PARTS--



The whole message looks like this (include HTTP header)
Content-Type: multipart/related; type="text/xml";
start="<9d645c8ebb837ce54abd027a3659535d>";
boundary="----=_Part_0_1977511.1123163571138"

------=_Part_0_1977511.1123163571138
Content-Type: text/xml; charset=UTF-8
Content-Transfer-Encoding: binary
Content-Id: <9d645c8ebb837ce54abd027a3659535d>



........

........

------=_Part_0_1977511.1123163571138
Content-Type: text/plain
Content-Transfer-Encoding: binary
Content-Id: <3936ae19fbed55ae4620b81c73bdd76e>

Binary Data.....
------=_Part_0_1977511.1123163571138--

No comments:

Post a Comment

 
TOPlist