Skip to main content

MTOM in JAXWS RI 2.0 Final

Posted by vivekp on May 12, 2006 at 7:25 PM PDT


JAXWS 2.0 RI  Final or FCS
version is

out
with a well tested MTOM support.  Functionality wise its same as
the EA3 release but has some very important bug fixes.

There are several bug fixes related to MTOM but I would like to mention couple of 
important ones:

  • Now @XmlMimeType can be used to annotate a method parameter or return types.
    This would result into xmime:expectedContentType in the generated schema and
    the MIME type would appear as Content-Type in the MIME part
public void sendImage(@XmlMimeType("image/png") java.awt.Image photo);

This would result into an equivalent XML schema declaration

<xml:element name="photo" type="xs:base64Binary" xmime:expectedContentType="image/png"/>

When serialzied over the wire, it will appear as:

--123@a.b.c
Content-Type:image/png
Content-ID:...
<http://a.b.c.org/photo1>
<Content-Transfer-Encoding: binary


¨wXVi
,Ú|h#PLÓ#$/
  • xmime:ContentType schema annotation is serialized correctly now. Tt was causing .NET interoperability problem

Santiago has done some MTOM performance analysis and has a blog on it. For smaller data sizes MTOM and XML almost perform the same however you start seeing the performance benefits above 5-6KB.

There is MTOM user document and sample that you can get from jaxws. So go and try it out and send your feedback to the dev alias. JAXWS 2.0 FCS is also also delivered as part of
Sun Java System Application Server PE 9 included in the
Java EE 5 SDK.
Check Carla's

blog
on the Sun Java System Application Server PE9.

Related Topics >>