java - wsimport 上的 WSDL 错误

标签 java web-services soap wsdl wsimport

我正在尝试连接到旧的 Web 服务,并且当我使用 wsimport 和其他工具自动生成类时收到错误。

computer-name:tmp me$ wsimport -keep -verbose https://www.entech.us/sigmaaldrich/CarbonFootprintStats.asmx?WSDL
parsing WSDL...

[WARNING] src-resolve.4.2: Error resolving component 's:schema'. It was detected that 's:schema' is in namespace 'http://www.w3.org/2001/XMLSchema', but components from this namespace are not referenceable from schema document 'https://www.entech.us/sigmaaldrich/CarbonFootprintStats.asmx?WSDL#types?schema1'. If this is the incorrect namespace, perhaps the prefix of 's:schema' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'https://www.entech.us/sigmaaldrich/CarbonFootprintStats.asmx?WSDL#types?schema1'.
  line 30 of https://www.entech.us/sigmaaldrich/CarbonFootprintStats.asmx?WSDL#types?schema1

[ERROR] undefined element declaration 's:schema'
  line 30 of https://www.entech.us/sigmaaldrich/CarbonFootprintStats.asmx?WSDL

问题是我需要让他们编辑 WSDL 以删除 s:schema 吗? WSDL 通过了验证,这更奇怪。

我知道仍然可以提取数据,因为许多在线 SOAP 客户端测试工具甚至 Eclipse 都允许我导航和执行这些方法。

预先感谢您的指导!

最佳答案

当您查看第 30 行的 xsd 时,您会看到以下行:

<s:element ref="s:schema"/>

enter image description here

此元素引用名为 s:schema 的简单或复杂类型。它看起来像是仅该行上的错误。WSDL 和 XSD 的其余部分似乎没问题,但定义不太明确。例如,响应只是空 <s:any/>标签。

他们需要澄清为什么他们试图声明一个元素来引用不存在的东西。它看起来确实像一个错误。

顺便说一下,WSDL 不符合 WSI。

关于java - wsimport 上的 WSDL 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23794647/

相关文章:

Spring WS (DefaultWsdl11Definition) 带有 void 的 HTTP 状态码

java - 尝试在 WSO2 Identity Server 中创建 ServiceProvider 时出现 ArrayIndexOutOfBoundsException

javascript - 获取未经授权的 Web 请求的 http 状态 401?

c# - 我在本地主机上的 ASP.NET Web 服务超时太快

java - jeditorpane 中的图像对齐 html

java - 突发 "unable to find valid certification path to requested target"

web-services - 您的组织如何设置测试数据?

java - 如何在 Spring 中查看 SOAP 请求的 XML 输出?

javascript - 为什么 p :inputTextArea value is not set?

java - 为什么它不允许我只输入 5 个数字,当我运行它时,它允许我输入 6 个数字