I tried to create an XJC plug-in that would take a list of classes and apply them as @XmlSeeAlso to emitted classes. This appeared to have promise, but then I ran into this bug:
https://jaxb.dev.java.net/issues/show_bug.cgi?id=645 I tried some of the suggested mitigations (like setting java.endorsed.dirs) but nothing seemed to work. Ultimately, I decided to hack in schema imports into the wsdls. We don't want to maintain a patchset of changes over these interfaces, so I will keep an eye on JAXB 2.1.13+ (when it's released). Perhaps then I can move back to this strategy. Oddly, this is not fixed in JAXB 2.2 (I checked). -----Original Message----- From: Vanore, Gregory [mailto:[email protected]] Sent: Tuesday, May 18, 2010 10:33 AM To: Daniel Kulp; [email protected] Subject: RE: Additional JAXBContext classes via JAX-WS API This is WSDL-first unfortunately. The classes in question are used for extension points in the WSDL that accept vendor-specific xsd:any blocks. I thought about trying to hook wsdl2java to see if I can get it to stick an @XmlSeeAlso on the generated classes - perhaps some sort of plugin, like the one that jams an "implements Serializable" on all the generated stubs. -----Original Message----- From: Daniel Kulp [mailto:[email protected]] Sent: Tuesday, May 18, 2010 10:19 AM To: [email protected] Cc: Vanore, Gregory Subject: Re: Additional JAXBContext classes via JAX-WS API On Tuesday 18 May 2010 10:07:41 am Vanore, Gregory wrote: > I have gotten custom classes added to my context successfully with the > jaxb.additionalContextClasses property. That was handy, and works well > when I'm using CXF's Spring configuration mechanism. I have on my hands > a client that uses the JAX-WS API and I need to get some of our custom > classes into this context somehow. Specifically, it is using > Service.create followed by a Service.getPort. I just don't see a > mechanism besides the WebServiceFeature to accomplish this. I've been > poring over the documentation on these features but can't seem to locate > anything. Does anyone else have some experience with this? If this is a java first type case, the normal way to handle this is to add an @XmlSeeAlso annotation onto the interface passed into getPort that points to all the additional classes that need to be added. The @XmlSeeAlso can also be added to any of the classes that JAXB would already know about. -- Daniel Kulp [email protected] http://dankulp.com/blog
