English 中文(简体)
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?

问题回答

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.

I solved this problem by changing XML namespace as below:

Change this

xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"

to

xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap/"

only 12 at the end is removed.





相关问题
Can t consume webservice from Java

I created the webservice stubs using axis2-1.5 s wsdl2java.bat. This created a src folder with the following structure in it: src/net/mycompany/www/services/SessionIntegrationStub.java The package ...

WSDL2Java tool error Apache CXF

We get the following error when we use WSDL2Java tool to generate stubs. The webservice is up and running. WSDLToJava Error: org.apache.cxf.wsdl11.WSDLRuntimeException: Fail to create wsd l ...

Code generation from WSDL using XML Catalog

Is there any tool for generating Java code from WSDL using XML Catalogs? The problem is that I have wsdl files that import XML schemas which also import other schemas and the schemas are not available ...

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....

Axis wsdl2java not generating all interfaces in stub

I am trying to generate stub using wsdl2java.bat, my wsdl consists of two bindings. I see that wsdl2bat creates interface for operations in the first binding but does not generate anything for ...

热门标签