【问题标题】:What does the WS-I BP2012 assertion mean?WS-I BP2012 断言是什么意思?
【发布时间】:2012-03-05 23:03:16
【问题描述】:

有人能解释一下这实际上是什么意思吗?举个例子会很有帮助。

WS-I: (BP2012) 文档文字绑定包含 soapbind:body 引用不具有 元素属性。

【问题讨论】:

    标签: web-services wsdl ws-i


    【解决方案1】:

    此消息与WS-I Basic Profile 相关,它试图阐明 WSDL 的子集和其他通常可互操作的规范。

    在这种情况下,BP2012 与以下内容相关联:

    描述中的文档文字绑定必须在其每个 wsoap12:body 元素,仅适用于 wsdl:part 元素 使用元素属性定义。

    如果您的网络服务中使用的消息之一是根据type 而不是element 定义的,您通常会看到这种情况,例如:

    <wsdl:message name="MyMessage">
        <wsdl:part name="MyPart" type="xsd:string"/>
    </wsdl:message>
    

    要解决此问题,您需要更改消息,以便将 part 定义为 element,如下所示:

    <wsdl:types>
        <xsd:schema targetNamespace="http://www.example.com/"
            xmlns:xsd="http://www.w3.org/1999/XMLSchema">
            <xsd:element name="MyElement" type="xsd:string"/>
        </xsd:schema>
    </wsdl:types>
    
    <wsdl:message name="MyMessage">
        <wsdl:part name="MyPart" element="tns:MyElement" xmlns:tns="http://www.example.com/"/>
    </wsdl:message>
    

    或者,您可能希望将 Web 服务从使用 document/literal 绑定切换到使用 rpc/literal 绑定。使用rpc/literal 绑定时,部件是根据type 而不是element 定义的。

    【讨论】:

      猜你喜欢
      • 2010-10-25
      • 2016-02-20
      • 1970-01-01
      • 2014-01-12
      • 2015-10-08
      • 2014-05-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多