Web services 如何在WSDL中将SOAP头标记为可选的?

Web services 如何在WSDL中将SOAP头标记为可选的?,web-services,soap,wsdl,tibco,Web Services,Soap,Wsdl,Tibco,我有一个带有可选标题的wsdl: <s:element name="AuthIdentifier" type="tns:AuthIdentifier"/> <s:complexType name="AuthIdentifier"> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="identifier" type="s:string"/> </s:sequenc

我有一个带有可选标题的wsdl:

<s:element name="AuthIdentifier" type="tns:AuthIdentifier"/>
<s:complexType name="AuthIdentifier">
  <s:sequence>
    <s:element minOccurs="0" maxOccurs="1" name="identifier" type="s:string"/>
  </s:sequence>
  <s:anyAttribute/>
</s:complexType>
我如何使它成为可选的?这样他就不用发送整个标题了?是否有
minOccurs
或类似的事件?或者它已经是可选的了吗?

根据“Web服务契约设计和版本控制”Thomas Erl等人(ISBN-13:978-0-13-613517-3)第15.4章,在WSDL中定义SOAP块:

WSDL1.1规范不清楚是否存在SOAP头 在WSDL文档中描述的内容必须由使用者包含或不包含。这个 WS-I基本配置文件强制消费者将其包括在内, 但是WDL2.0提供了消费者是否应该 被迫包括或不包括它们。第472页


在WSDL 2.0中,您可以在自定义SOAP头块中设置属性WSDL:required=“false”,以指示使用者是否必须包含此头块。

我对Tibco也有同样的问题。你修好了吗?那个片段定义了头的结构吗?如果是,请尝试
<Header.AuthIdentifier>
   <ns0:AuthIdentifier xmlns:ns0 = "http://www.tal.com/schemas"/>
</Header.AuthIdentifier>