2

I am working on a project to utilize Apache cxf 3.x to implement a soap client, which was initially developed on Axis 1.4. This project used axis wsdl2java to generate all java soap stubs from a posted wsdl. When I applied cxf wsdl2java on the same wsdl and expected the same sets of soap stubs to be generated, I started to realize that newly generated stubs in CXF became incompatible as many methods changed. I really appreciated any suggestions to help me re-route the logic to the new service client on CXF.

Most of soap stubs were quite similar. However, looks like CXF approach is missing a key class that was used by upper layer to configure endpoint and IP address of the service. Let's say the name of service is Sample. There is a method called SampleLocator.java, which was generated by axis wsdl2java. It was not there anymore when CXF wsdl2java was applied. This SampleLocator class was extended from axis.client.service and implemented from Sample interface on axis approach. However, instead the CXF approach only generated a Sample class which extends javax.xml.ws.service.

Here are some snippets to show the difference, On Axis, the following methods are posted in generated SampleLocator.java,

getSample, 
getServiceName,
getPorts,
setEndpointAddress, etc

On CXF, the following methods are posted in generated Sample.java,

getSample, etc.

The sample wsdl file is also attached below for reference (partially),

<service name="Sample">
    <port name="Sample" binding="tns:Sample">
        <SOAP:address location="http://localhost:80"/>
    </port>
</service>

0 Answers0