0
votes

I have to generate Java code from a wsdl file. Currently my project uses wsimport, but the wsdl file for which I have to generate code has RPC encoding. wsimport has no support for RPC. I tried using axis but it fails with following error:

soap:fault element not recognized for soap 1.2 binding

I found a jira already for this issue: https://issues.apache.org/jira/browse/AXIS-2614

axis2 doesn't support RPC. Is there any other way I can generate the code from the wsdl using maven.

2

2 Answers

0
votes

You can also use Axis1 framework. It is old, but available on https://axis.apache.org/axis There you can find a tool called wsdl2Java, which you can execute like:

java -cp <all jars of the framework> \
org.apache.axis.wsdl.WSDL2Java \
-p <destination package name> \
-o <destination src path> \
http://[Servername]/MyService?wsdl

This generates all classes from the wsdl service description file. Then you can use the Stub classes to access the service.

The last snapshot version you can find on https://builds.apache.org/job/axis-trunk Click on "Last Build" and then on "Distribution" (or Maven Plugin).