You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Daniel Kulp <dk...@apache.org> on 2008/01/04 23:53:45 UTC

Re: Getting extra schemas into JAXB/JAXWS with spring


On Sunday 23 December 2007, Benson Margulies wrote:
> I ran wsdl2js for a service that includes an 'extra' schema whose only
> purpose in life is to contain elements for use with xs:any.
>
> When I then turn around and deploy, the extra schema falls out of the
> service model.
>
> There must be some way to use the ObjectFactory class for the extra
> schema to get it into the picture at runtime. Clue?


There are several ways to do it.   On trunk (jax-ws 2.1), it's much 
easier as you can add an @XmlSeeAlso annotation to your service to have 
it SeeAlso any class in the other package.   The JAXB databinding will 
automatically grab the ObjectFactory from any package for any class 
referenced with the SeeAlso.

For 2.0.x, it's a bit trickier.   There is a 
jaxb.additionalContextClasses key that can be set in the properties that 
points to an array of classes or something like that that can be used to 
provide additional stuff for jaxb.   See the file:

systests/src/test/resources/extrajaxbclass.xml

for an example.


-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog