Using custom XML Serialization with CXF JAX-WS

471 Views Asked by At

I have used scalaxb to generate Scala friendly classes from my xsd and would like to use these classes in the server-side implementation of my JAX-WS (SOAP) WebService.

I however, do not know how I can tell CXF to use scalaxb for marshalling as opposed to JAXB.

Can anyone tell me what steps I need to follow to accomplish this?

1

There are 1 best solutions below

0
On

I think you have to write a custom data binding implementation for this.

For example, you can use xmlbeans as one of the supported bindings in this way:

<jaxws:server serviceClass="demo.hw.server.HelloWorld" address="/hello_world">
    <jaxws:dataBinding>
       <bean class="org.apache.cxf.xmlbeans.XmlBeansDataBinding" />
    </jaxws:dataBinding>
</jaxws:server>

You have to implement your own "ScalaDataBinding" and simply put your class name to the configuration.