Reputation: 181
I have a wsdl with an optional header:
<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>
The client is using an integration software (tibco)
to connect to my service and claims that the header is required, so he must send it with an empty value:
<Header.AuthIdentifier>
<ns0:AuthIdentifier xmlns:ns0 = "http://www.tal.com/schemas"/>
</Header.AuthIdentifier>
How do I make it optional? So that he won't have to send the whole header at all? Is there a minOccurs
or something like that? Or is it already optional as it is now?
Upvotes: 17
Views: 1875
Reputation: 4621
According to "Web Service Contract Design & Versioning" Thomas Erl et al (ISBN-13: 978-0-13-613517-3) Chapter 15.4, Defining SOAP Blocks in WSDL:
The WSDL 1.1 Specification is unclear about whether SOAP headers described in a WSDL document must be included by consumers or not. The WS-I Basic Profile made it mandatory for consumers to include them, but WDL 2.0 provides the choice as to whether consumers should be forced to include them or not. Page 472.
In WSDL 2.0 you can set the attribute wsdl:required="false" in the custom SOAP header block to indicate whether consumers must include this header block.
Upvotes: 4