Apache XMLBeans is another technology for mapping XML Schema to java objects. CXF added support for XMLBeans in 2.1. Note that this data-binding has been removed from Apache CXF 3.2.0 onwards, as Apache XMLBeans has been retired to the attic.
There are a two parts to the support for XMLBeans:
...
For the server side, your spring configuration would contain something like:
Code Block | ||||
---|---|---|---|---|
| ||||
<jaxws:server serviceClass="demo.hw.server.HelloWorld" address="/hello_world">
<jaxws:dataBinding>
<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding" />
</jaxws:dataBinding>
</jaxws:server>
|
or
Code Block | ||||
---|---|---|---|---|
| ||||
<jaxws:endpoint
id="helloWorld"
implementor="demo.spring.HelloWorldImpl"
address="http://localhost/HelloWorld">
<jaxws:dataBinding>
<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding" />
</jaxws:dataBinding>
</jaxws:endpoint>
|
The client side is very similar:
Code Block | ||||
---|---|---|---|---|
| ||||
<jaxws:client id="helloClient"
serviceClass="demo.spring.HelloWorld"
address="http://localhost:9002/HelloWorld">
<jaxws:dataBinding>
<bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding" />
</jaxws:dataBinding>
<jaxws:client>
|
...
If using programmatic factory beans instead of spring configuration, the databinding can be set on the ClientProxyFactoryBean (and subclasses) and the ServerFactoryBean (and subclasses) via:
Code Block | ||||
---|---|---|---|---|
| ||||
factory.getServiceFactory().setDataBinding(new org.apache.cxf.xmlbeans.XmlBeansDataBinding());
|