这个 wsdl 片段非法吗?

发布于 2024-12-11 19:32:29 字数 1856 浏览 0 评论 0原文

我正在挠头。该 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技术交流群

发布评论

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

评论(1

横笛休吹塞上声 2024-12-18 19:32:29

我成功进行了更改,允许 Visual Studio 2008 从服务器检索 WSDL 并生成代码。步骤是

1) 配置 CXF 以显示原始 WSDL 文件而不是其生成的版本
2) 将导入的模式更改为内联在 WSDL 中,直到 Visual Studio 满意为止

详细信息:

1) 在 CXF 配置文件中添加 wsdlLocation 属性

<jaxws:endpoint xmlnse="urn:discovery.services.sec.com"
    id="DiscoveryImpl"
    endpointName="e:discovery"
    serviceName="e:DiscoveryService"
    address="discovery"
    implementor=com.sec.services.discovery.DiscoveryImpl"
    wsdlLocation="WEB-INF\discovery.wsdl
>

有多种方法可以指定 WSDL 位置。谷歌代码搜索很有帮助。

2) 最初的 WSDL 开始

...

删除上面的导入,结果是

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions ...>
    <wsdl:types>
        <xsd:schema ..> <!-- Discovery.xsd contents here -->
                ...
        </xsd:schema>   
    </xsd:types>
        <xsd:schema ..>
            <!-- import of Discovery.xsd removed from here -->
                ...
        </xsd:schema>   
    </xsd:types>
    <wsdl:message ...>

我希望这可以节省其他一些时间。

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

<jaxws:endpoint xmlnse="urn:discovery.services.sec.com"
    id="DiscoveryImpl"
    endpointName="e:discovery"
    serviceName="e:DiscoveryService"
    address="discovery"
    implementor=com.sec.services.discovery.DiscoveryImpl"
    wsdlLocation="WEB-INF\discovery.wsdl
>

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

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions ...>
    <wsdl:types>
        <xsd:schema ..> <!-- Discovery.xsd contents here -->
                ...
        </xsd:schema>   
    </xsd:types>
        <xsd:schema ..>
            <!-- import of Discovery.xsd removed from here -->
                ...
        </xsd:schema>   
    </xsd:types>
    <wsdl:message ...>

I hope this saves some else a little bit of time.

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