Brian Pontarelli wrote:
> Yeah, I'm getting a JAXBElement<SomeRequest> returned from the
> unmarshaller rather than a SomeRequest. I just included the
> ObjectFactory code to show you what is being generated. The SomeRequest
> and Request classes look like normal JavaBeans and have the correct
> annotations. Just looks like the unmarshaller is doing something strange.
The fact that the unmarshaller returns JAXBElement<SomeRequest> is
actually by design. We are concerned about the usability implication of
this, but OTOH we need this to support 100% XML Schema --- the idea here
is that JAXBElement captures the tag name, which could be changed as a
result of a substitution group.
So in general, the unmarshal method can return JAXBElement.
I'm curious what your thoughts are.
For this particular case, I think we changed the XJC since the WS-I TP
release so that it will not generate the code that uses JAXBElement, and
it will associate "someRequest" element directly with the SomeRequest class.
--
Kohsuke Kawaguchi
Sun Microsystems kohsuke.kawaguchi_at_sun.com