Are you using ServerFactoryBean or are you using a JAX-WS
style "Endpoint.publish"?
Basically, you need to set the property:
jaxb.additionalContextClasses
to a Class[].
For that ServerFactoryBean stuff, just call:
Class classes[] = .......
bean.getProperties().put("jaxb.additionalContextClasses"
classes);
before you call create().
For the other case, I'm not sure, but I think you do:
Endpoint ep = Endpoint.create(....);
ep.setProperty("jaxb.additionalContextClasses"
classes);
ep.publish(...);
Alternatively, we do have samples in the docs on how to set the databinding
programmaticly (look in the Aegis databinding section). You can create your
own instance of JAXBDataBinding, call the setAdditionalClass(...) method, set
that into the factory, etc....
Dan
On Wednesday 20 August 2008 1:12:17 am Rahul Dev wrote:
> Thanks Dan for your mail.
>
> The server is started as a standalone server. Is there a way by which we
> can use API's to register these 55 classes manually inside the standalone
> source code?
>
> Managing external XML files for these would be difficult from a maintenance
> point.
>
> We are dynamically detecting the classes during bootup and would like to
> have all these classes dynamically loaded.
>
> Rahul
>
> Daniel Kulp <[EMAIL PROTECTED]> wrote:
> Are you talking about JAXB databinding?
>
> If so, there are a couple options:
>
> 1) Add the XmlSeeAlso annotation to the interface and point it at all 55
> classes.
>
> 2) If at least one class in the package containing the 55 classes is picked
> up via a parameter on another method or something, you can put a jaxb.index
> file in the package that is just a list of all the class names (minus the
> package).
>
> 3) There is also a jaxb.extraclasses property that can be added to the
> configuration of the endpoint to have it load additional classes. See:
> http://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/resources/extra
>jaxbclass.xml
>
> Dan
>
> On Tuesday 19 August 2008 11:43:15 am Rahul Dev wrote:
> > Hi,
> >
> > I have a WS interface that looks like this
> > public List getResults(Date FromDate, Date ToDate);
> >
> > The problem is that List can return any of the 55 java pojo model classes
> > that we have defined. None of these implement any interface either.
> >
> > When I generate WSDL, I would like all these 55 classes to appear in the
> > XSD so that the client can recognize them.
> >
> > Because the return type is List and the list can contain any object that
> > implements Serializable, the client can never know what objects can come.
> >
> > Is there a way by which I can define these 55 custom classes?
> > Rahul
--
Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog