users@jaxb.java.net

Re: unmarshalling a MIME package

From: Kohsuke Kawaguchi <kohsuke.kawaguchi_at_Sun.COM>
Date: Wed, 02 Nov 2005 11:01:59 -0800

Mark Hansen wrote:
> If you set the AttachmentUnmarshaller using
> Unmarshaller.setAttachmentUnmarshaller, does that mean that you can pass
> the Unmarshaller a MIME package - maybe as a stream using
> Unmarshaller.unmarshal(java.io.InputStream is) method?

No. What that means is that:

1. you parse MIME package
2. you pick up the XML part of it
3. you implement AttachmentUnmarshaller
4. you set AttachmentUnmarshaller to JAXB
5. you tell JAXB to unmarshal the XML part.

JavaMail has a very handy MIME handling classes to make it relatively
painless to do the above.

> Or do you need to let the JAX-WS implementation do the MIME processing
> and delegate the MTOM unmarshalling to JAXB "behind the scenes"?

JAX-WS does all the 5 steps illustrated above, but you can do it if you
want to process XOP outside JAX-WS.


-- 
Kohsuke Kawaguchi
Sun Microsystems                   kohsuke.kawaguchi_at_sun.com