As a minor correction to myself, we don't actually register the SEI itself
with the JAXBContext, we register the input/output/exc-fault types.     So
it's the @XmlSeeAlso on those that actually does the job here... which
wsimport produces in addition to @XmlSeeAlso on the SEI.

That distinction probably only matters if you're coding the @XmlSeeAlso by
hand.



On Thu, Nov 20, 2008 at 2:48 PM, Raymond Feng <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I'm aware of the @XmlSeeAlso annotation but didn't know the wsimport
> code-gen is smart enough to use it to hint sub types :-).
>
> Thanks,
> Raymond
>
> From: Scott Kurz
> Sent: Thursday, November 20, 2008 11:29 AM
> To: [email protected]
> Subject: JAXB and derived types / subclasses - better story in Java 6 /
> JAXB 2.1
>
>
>
> Just a follow-up to a discussion we had a few months ago on how to use
> derived/subclass JAXB types together with interfaces defined
> in terms of base/superclass types......
>
> In the JAXB 2.1 level of tooling, wsimport leverages a new JAXB annotation
> @XmlSeeAlso to make this a lot smoother.
>
> So if you just import the derived types XSD into your WSDL types section
> and then run wsimport, the generated interface (the one with @WebService)
> will be generated with an @XmlSeeAlso for your derived types ObjectFactory.
>
> So when the interface class itself is loaded (registered) to JAXB , the
> associated subclasses will be registered as well.
>
> So there's a happy ending...
>
> Scott
>

Reply via email to