Hi,
This is my first post and I hope I'm not asking something that has been
beaten to death in earlier threads so please apologize if I violate any
rules.
I have the following problem:
My project depends on a JAR that contains a class, which handles the Web
Service invocation. More specific, this is how it invokes the client:
...
URL serviceURL = new URL("http://dev.host.com/myapp/myservice?wsdl");
QName serviceQName = new QName("urn:my:namespace:test", "MyService");
...
Service service = Service.create(serviceURL, serviceQName);
servicePort = service.getPort(MyServiceSEI.class);
SomethingResponse response = servicePort.doSomething(somethingRequest);
...
Now the "somethingRequest" object is a JAXB annotated class that is
provided together with the MyServiceSEI class in the same package. However
the SomethingRequest class allows for externally defined JAXB annotated
objects to be be set. Of course the JAXBContext will not know the
externally defined classes during the marshalling process and throws an
exception. To solve the issue I created a cxf.xml with the following client
configuration and added it to the META-INF of my main application (not the
JAR that contains the client):
...
<jaxws:client name="{urn:my:namespace:test}MyPort" createdFromAPI="true">
<jaxws:dataBinding>
<bean class="org.apache.cxf.jaxb.JAXBDataBinding">
<property name="ExtraClass">
<list>
<value>com.my.external.package.binding.ObjectFactory</value>
</list>
</property>
</bean>
</jaxws:dataBinding>
</jaxws:client>
...
After building, deploying, and testing I still have the exception that
states that the externally defined class is not part of the JAXBContext.
What am I missing/doing wrong?
Thanks,
Steffen