cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kazimierz Pogoda <hsh...@gmail.com>
Subject common JAXB data bindings and schema for different services
Date Thu, 08 Jul 2010 08:50:43 GMT
Here is the example situation:

@WebService(serviceName = "Service1")
public interface Service1 {
    void doSomething(@WebParam(name = "token", mode = Mode.IN) Token token);
}

@WebService(serviceName = "Service2")
public interface Service2 {
    void doSomethingDifferent(@WebParam(name = "token", mode =
Mode.IN) Token token);
}

public class Input {
    private String value;
}

Both services share the same class Token. I can publish both of them using:

EndpointImpl endpoint = (EndpointImpl) Endpoint.create(serviceImpl);
endpoint.setAddress(serviceName);
endpoint.setImplementorClass(serviceInterface);
endpoint.publish(m_baseUrl + serviceInterface.getSimpleName());

But then in the debug log of JAXB I see something like:

com.sun.xml.bind.v2.runtime.reflect.opt.Injector: Caused by:
java.lang.LinkageError: loader (instance of
sun/misc/Launcher$AppClassLoader): attempted  duplicate class
definition

Regardless of this debug message everything works fine. In generated
wsdl file I see <wsdl:types> section where token type is defined
separately for every single service.

Is it possible to generate XML schema for all the types which will be
used as method arguments (In my case I have a list of these classes
already before creating Endpoint) and publish xsd file together with
generated wsdl file which would reference this xsd in <wsdl:types>
section?

I tried to use:

JAXBDataBinding dataBinding = JAXBDataBinding(Token.class);
EndpointImpl endpoint = (EndpointImpl) Endpoint.create(serviceImpl);
endpoint.setAddress(serviceName);
endpoint.setImplementorClass(serviceInterface);
endpoint.setDataBinding(dataBidng);
endpoint.publish(m_baseUrl + serviceInterface.getSimpleName());


But it does not work - no <wsdl:types> section in generated at all.


-- 
"Meaning is differential not referential"

kazik 'morisil' pogoda
http://www.xemantic.com/ http://blog.xemantic.com/

Mime
View raw message