This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

How exactly does MTOM shrink the payload?  RSS feed

Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, So MTOM sends base64 encoded binary data outside the XML document. Great.
But it's also possible to encode base64 binary data inside the XML document.

So does MTOM really shrink the overall payload by that much? And if so how?
Author and all-around good cowpoke
Posts: 13078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, for one thing, any text inside the XML document will be parsed, at vast expense in parser time and object creation.

The great disadvantage to using the SOAP body for large amounts of text was recognized early - leading to SAAJ and similar kludges.

I clearly remember people screaming on SOAP newsgroups about requests taking many minutes to process - because the XML parser was grinding away at some huge payload that really didn't belong in the SOAP body at all.

Also why RESTful architectures are preferred if you don't absolutely need SOAP WS-*

Luke Murphy
Ranch Hand
Posts: 300
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill.

Just reading a bit more into this. According to Martin Kalin in 'Java Web Services Up and Running' base 64 encoding result in Data bloat results in payloads of up to 1 / 3 larger than raw data. Therefore using a binary attachment via SAAJ with no encoding is actually a smaller over all payload than a SOAP message with embedded base 64 encoded data.

The downside with going with raw data is that it means the receiver has to deal with them and covert into something meaningful.
It is also hard to use this approach with a document-style service. There are also inter operability issues.

MTOM is backed by W3C. It is used XOP (XML Optimized Packaging) to optimize the payload. So in terms of efficiency and interoperability it wins.

All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!