Apache Axis WSDL2Java 错误 - 缺少;元素

发布于 2024-08-19 07:37:44 字数 873 浏览 11 评论 0原文

我们正在我们的应用程序中集成第三方 SOAP Web 服务。 WSDL 与 SOAPUI 工具一起使用,示例请求和响应工作正常。

当我们尝试与 apache Axis 1.3 集成时,我们尝试了 WSDL2JAVA 与 WSDL。我们收到以下错误

java.io.IOException:错误:在绑定 saveRegistration 操作“serviceFault”中缺少元素 inFault“serviceFault” 在 org.apache.axis.wsdl.symbolTable.SymbolTable.faultsFromSOAPFault(SymbolTable.java:2858) 在 org.apache.axis.wsdl.symbolTable.SymbolTable.populateBindings(SymbolTable.java:2549) 在 org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:744) 在 org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:543) 在 org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518) 在 org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495) 在 org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361) 在 java.lang.Thread.run(未知来源)

有人已经遇到过这个问题并解决了吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦醒时光 2024-08-26 07:37:44

我相信有一个针对此开放的 JIRA

描述:

当你有一个soap 1.2与soap错误绑定时,错误元素没有被正确提取,导致错误

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

他们的临时建议是添加一行代码并重新编译Axis1......不。

就个人而言,我刚刚下载了 wsdl 文件(它是 Axis 2 服务,我有一个 Axis 1.5 客户端)并编辑了以下所有行的命名空间: 到

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

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

正如建议的 此处

然而,升级到 Axis2 是最佳的长期解决方案。解决此问题后,我在 WSDL2JAVA 生成的代码中发现了更多错误。

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.

ぃ弥猫深巷。 2024-08-26 07:37:44

我通过更改 XML 命名空间解决了这个问题,如下所示:

更改此

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

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

仅删除末尾的 12

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文