WSDL文档中允许多少个WSDL规范可扩展性元素

问题描述

|| 可以使用可扩展性元素(例如SOAP)来扩展wsdl规范。 这些可扩展性元素出现在wsdl文档的绑定,操作和端口部分周围(http://www.w3.org/TR/wsdl-2.1 WSDL文档结构) 我正在尝试解析wsdl文档,该规范似乎并未详细说明在给定位置可能出现多少个可扩展性元素。例如。对于给定的绑定,是否可以应用多个扩展,例如下面的示例?
<binding name=\"StockQuoteSoapBinding\" type=\"defs:StockQuotePortType\">
  <soap:binding style=\"document\" transport=\"http://schemas.xmlsoap.org/soap/http\"/>
  <foo:otherextension foo=\"bar\"/>
虽然没有定义扩展名的数量限制,但是也没有任何示例可以演示使用多个扩展名。     

解决方法

WSDL的XML模式表示在定义为可扩展的元素之一中可以使用无数个元素(只要它们属于WSDL外部的名称空间):
<xs:complexType name=\"tExtensibleDocumented\" abstract=\"true\">
    <xs:complexContent>
        <xs:extension base=\"wsdl:tDocumented\">
            <xs:annotation><xs:documentation>
            This type is extended by component types to allow elements from other namespaces to be added.
            </xs:documentation></xs:annotation>
            <xs:sequence>
                <xs:any namespace=\"##other\" minOccurs=\"0\" maxOccurs=\"unbounded\" processContents=\"lax\"/>
            </xs:sequence>
        </xs:extension>
    </xs:complexContent>
</xs:complexType>