这个 wsdl 片段非法吗?
我正在挠头。该 WSDL 由 CXF 生成。它喜欢输入 WSDL 和模式文件,但当我尝试创建测试项目时 SOAPUI 会抱怨。整个 wsdl 太长,但这里是与错误消息匹配的部分:
<xs:complexType name="RelatedResourcesType">
<xs:sequence>
<xs:element minOccurs="0" name="RelatedResource">
<xs:complexType>
<xs:complexContent>
<xs:extension base="tns:CompoundResourceIdentifierType">
<xs:sequence>
<xs:element minOccurs="0" name="link">
<xs:complexType>
<xs:sequence/>
<xs:attribute ref="ns3:type" xmlns:ns3="http://www.w3.org/1999/xlink"/>
<xs:attribute ref="ns4:href" use="required" xmlns:ns4="http://www.w3.org/1999/xlink"/>
<xs:attribute ref="ns5:role" xmlns:ns5="http://www.w3.org/1999/xlink"/>
<xs:attribute ref="ns6:title" xmlns:ns6="http://www.w3.org/1999/xlink"/>
<xs:attribute ref="ns7:label" xmlns:ns7="http://www.w3.org/1999/xlink"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
Error: Could not find attribute 'type@http://www.w3.org/1999/xlink' 你的意思是引用该属性命名为 type@http://dws.sec?
错误:找不到属性“href@http://www.w3.org/1999/xlink”
错误:找不到属性“role@http://www.w3.org/1999/xlink”您的意思是引用到名为 role@http://www.w3.org/2003/05/soap-envelope 的属性?
错误:找不到属性“title@http://www.w3.org/1999/xlink” 您的意思是引用名为 title@http://metadata.esd.com/ 的属性吗?
错误:找不到属性“label@http://www.w3.org/1999/xlink” 您的意思是引用名为 title@http://metadata.esd.com/ 的属性吗?
所以这些应该都来自 xlink 定义,我不知道为什么它没有看到它。有什么想法吗?或者建议下一步尝试什么?
I'm scratching my head. This WSDL is generated by CXF. It liked the input WSDL and schema files but SOAPUI is complaining when I try to create a test project. The whole wsdl is too long but here is the part that matches up with the error messages:
<xs:complexType name="RelatedResourcesType">
<xs:sequence>
<xs:element minOccurs="0" name="RelatedResource">
<xs:complexType>
<xs:complexContent>
<xs:extension base="tns:CompoundResourceIdentifierType">
<xs:sequence>
<xs:element minOccurs="0" name="link">
<xs:complexType>
<xs:sequence/>
<xs:attribute ref="ns3:type" xmlns:ns3="http://www.w3.org/1999/xlink"/>
<xs:attribute ref="ns4:href" use="required" xmlns:ns4="http://www.w3.org/1999/xlink"/>
<xs:attribute ref="ns5:role" xmlns:ns5="http://www.w3.org/1999/xlink"/>
<xs:attribute ref="ns6:title" xmlns:ns6="http://www.w3.org/1999/xlink"/>
<xs:attribute ref="ns7:label" xmlns:ns7="http://www.w3.org/1999/xlink"/>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
...
...
Error: Could not find attribute 'type@http://www.w3.org/1999/xlink' Do you mean to refer to the attribute named type@http://dws.sec?
Error: attribute 'href@http://www.w3.org/1999/xlink' not found
Error: Could not find attribute 'role@http://www.w3.org/1999/xlink' Do you mean to refer to the attribute named role@http://www.w3.org/2003/05/soap-envelope?
Error: Could not find attribute 'title@http://www.w3.org/1999/xlink' Do you mean to refer to the attribute named title@http://metadata.esd.com/?
Error: Could not find attribute 'label@http://www.w3.org/1999/xlink' Do you mean to refer to the attribute named title@http://metadata.esd.com/?
So these should all be coming from the xlink definition and I'm not sure why it's not seeing it. Any thoughts? or suggestions for what to try next?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我成功进行了更改,允许 Visual Studio 2008 从服务器检索 WSDL 并生成代码。步骤是
1) 配置 CXF 以显示原始 WSDL 文件而不是其生成的版本
2) 将导入的模式更改为内联在 WSDL 中,直到 Visual Studio 满意为止
详细信息:
1) 在 CXF 配置文件中添加 wsdlLocation 属性
有多种方法可以指定 WSDL 位置。谷歌代码搜索很有帮助。
2) 最初的 WSDL 开始
...
删除上面的导入,结果是
我希望这可以节省其他一些时间。
I had success making changes that allowed Visual Studio 2008 to retrieve the WSDL from the server and to generate code. The steps were
1) Configure CXF to display the original WSDL files instead of its generated version
2) Change imported schemas to be inline in the WSDL until Visual Studio is happy
Details:
1) In the CXF configuration file add the wsdlLocation attribute
There are several ways to specify the WSDL location. Google Code Search was helpful.
2) The original WSDL started off
...
Removing the import above, the result is
I hope this saves some else a little bit of time.