Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache Axis WSDL2Java error - Missing <soap:fault> element

We are integrating a third party SOAP web services in our application. The WSDL is used with SOAPUI tool, where sample requests and responses worked fine.

When we try to integrate with apache Axis 1.3, where we tried WSDL2JAVA with the WSDL. We received the following error

java.io.IOException: ERROR: Missing element inFault "serviceFault" in operation "serviceFault", in binding saveRegistration at org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(SymbolTable.java:2858) at org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolTable.java:2549) at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:744) at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:543) at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518) at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495) at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361) at java.lang.Thread.run(Unknown Source)

Anyone already faced this issue and solved?

like image 874
Pearl Avatar asked Jan 25 '10 23:01

Pearl


People also ask

What is Axis SOAP?

Axis is essentially a SOAP engine -- a framework for constructing SOAP processors such as clients, servers, gateways, etc. The current version of Axis is written in Java, but a C++ implementation of the client side of Axis is being developed.

How do I use Axis Web services?

Axis2 Web Service invocation using Stub Files. Create a Java Project Axis2Client in Eclipse. Create lib folder and copy all the Axis2 jars from downloaded binary distribution lib folder. Add these jars to the build path of the project.

What is org Apache Axis?

Apache Axis (Apache eXtensible Interaction System) is an open-source, XML based Web service framework. It consists of a Java and a C++ implementation of the SOAP server, and various utilities and APIs for generating and deploying Web service applications.


1 Answers

I believe that there is a JIRA open for this one.

Description:

When you have a soap 1.2 binding with soap fault, the fault element is not correctly extracted, resulting in error

 ERROR: Missing <soap:fault> element inFault "..." in operation "...", in binding ...

Their temporary recommendation is adding a line of code and recompiling Axis1... Nahh.

Personally, I've just downloaded the wsdl file (it's an Axis 2 service and I have an Axis 1.5 client) and edited the namespace for all of the following lines from:

     <wsdl:fault name="Exception">
        <soap12:fault use="literal" name="Exception"/>
     </wsdl:fault>

to:

     <wsdl:fault name="Exception">
        <soap:fault use="literal" name="Exception"/>
     </wsdl:fault>

As suggested here.

Upgrading to Axis2, however, is the best long term solution. After resolving this issue, I have found yet more errors in the code that WSDL2JAVA has generated.

like image 101
ian_scho Avatar answered Oct 05 '22 11:10

ian_scho