【问题标题】:WSDL error on wsimportwsimport 上的 WSDL 错误
【发布时间】:2014-05-21 22:05:05
【问题描述】:

我正在尝试连接到旧的 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 都允许我导航和执行这些方法。

提前感谢您的指导!

【问题讨论】:

    标签: java web-services soap wsdl wsimport


    【解决方案1】:

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

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

    这个元素是指一个简单或复杂的类型,叫做s:schema。它看起来只是那条线上的一个错误。WSDL 和 XSD 的其余部分似乎还可以,但定义得不是很好。例如,响应只是空的&lt;s:any/&gt; 标签。

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

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

    【讨论】:

    • 您使用的是哪种验证工具?我看到它检查出来了,但是当我尝试解析它时,它的定义很差并且容易出错。
    • @JohnMathews 对 WSDL 的任何认真工作,看看 SOAP UI 进行测试。用于设计的 Altova XMLSpy 或 Liquid XML。
    • 我希望不再使用 WSDL 做任何工作,这是一个不应该花这么长时间的工作:-(
    • @johnmathews 这个 WSDL 有点乱,通常它们很容易使用。这似乎是他们做了一些非常肮脏的事情,或者作者才刚刚开始。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多