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