The Source for Java Technology Collaboration
User: Password:



Vivek Pandey

Vivek Pandey's Blog

MTOM in JAXWS RI 2.0 Final

Posted by vivekp on May 12, 2006 at 07:25 PM | Comments (5)

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.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Is @XmlMimeType on a parameter supposed to work with the JAX-WS RI? I tested this with the latest release, and it definately doesn't. The spec doesn't mention anything about copying JAXB annotations from method params when building a wrapper bean. Not that I am against this feature, I think its a great addition. Just wondering if this is was pulled for some reason.

    -Jason

    Posted by: jgreene on August 17, 2006 at 05:06 PM

  • Yes, @XmlMimeType annotation is suppoed to work on a parameter. I think there was a bug that was fixed in JAXB 2.0 RI sometime back. If you're using JAXWS 2.0 FCS version you should see it working. You can also try latest JAXWS 2.0.1 M1 release.

    Posted by: vivekp on August 17, 2006 at 10:31 PM

  • I tried FCS, M1, and the latest nightly build. I will go ahead and post a bug report then. Thanks

    Posted by: jgreene on August 18, 2006 at 09:10 AM

  • I am attempting to use a .NET client to consume a JAX-WS 2.1 RI FCS service with MTOM enabled. I am using Visual Studio 2005 with the WSE 3.0 enhancements. I get an exception in my c# client:

    {"Response is not well-formed XML."}

    The details of the exception say:

    {"WSE1610: The XOP package contained a MIME part missing a content-id header."}

    Any idea what's going on?

    Posted by: cmoesel on February 06, 2007 at 01:22 PM

  • Wow-- I just realized I commented on a very old blog... I'll move this question to a forum.

    Posted by: cmoesel on February 06, 2007 at 01:24 PM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds