Saturday, July 21, 2007

More Thoughts

Spend some of today doing more research on the feasibility of implementing MTOM in ruby using the rails framework. As expected, there really isn't any action happening with MTOM outside of the Java and .NET worlds. But I did find a lot of interesting analysis of the MTOM spec that should be a big help. First off, this article was quite helpful:

http://www.devx.com/xml/Article/34797

I was originally pretty worried that MTOM includes some weird formatting of the HTTP header, which I wouldn't have access to using the rails framework, but except for the content-type (which one can get access to through the @headers instance variable in the ActionController class), the HTTP header is essentially the same. FYI - for setting a unique HTTP content type in rails, check out this article. That means that the transformation occurs on the HTTP body only.

Basically, there are four things to set/read in a SOAP message to indicate that MTOM has been used:

  1. The application/xop+xml media is present
  2. The media type of the HTTP message is multipart/related.
  3. The media type of the root part of the MIME Multipart/Related package is application/xop+xml.
  4. The start-info parameter indicates a content type of application/soap+xml.
The other really interesting thing I found out is that MTOM can be implemented on top of SOAP 1.1. These guys at IBM came up with a white paper on how to indicate an MTOM'd message using SOAP 1.1. I haven't had a chance to read it in depth, but it looks promising (and gives me an excuse to drop the SOAP1.2 part of this project :).

One more thing I'm noticing is that there aren't any MTOM test tools or validators out there. That is going to make testing any implementation I do in ruby pretty difficult (unless I want to set up a Java endpoint myself!) If anyone out there is interested in coding a basic Java/.NET MTOM endpoint, shoot me an email: mjreich at gmail dot com.

No comments: