1 Reply Latest reply on Mar 13, 2014 3:05 AM by Magesh Bojan

    Enforcing Mandatory SOAP Headers

    Richard Hands Newbie



      I've got a switchyard composite which is exposing a WSDL service via a SOAP binding, and that WSDL service defines, on each operation,


      <soap:header message="tns:ProcessMessageExchangeHeader" part="ExchangeHeader" use="literal" wsdl:required="true"/>


      (for completeness here's the other bits relevant to the exchangeheader)


      <xsd:element name="ExchangeHeader" type="tns:ExchangeHeader" />
      <xsd:complexType name="ExchangeHeader">
          <xsd:element minOccurs="0" maxOccurs="1" name="MsgID"
            type="xsd:string" />
          <xsd:element minOccurs="1" maxOccurs="1" name="MsgDateTime"
            type="xsd:dateTime" />
          <xsd:element minOccurs="0" maxOccurs="1" name="MsgMEPRole"
            type="xsd:string" />
          <xsd:element minOccurs="0" maxOccurs="1" name="MsgCorrID"
            type="xsd:string" />
          <xsd:element minOccurs="0" maxOccurs="1" name="MsgSource"
            type="xsd:string" />
          <xsd:element minOccurs="0" maxOccurs="1" name="MsgDestination"
            type="xsd:string" />


      <wsdl:message name="ProcessMessageExchangeHeader">
        <wsdl:part name="ExchangeHeader" element="tns:ExchangeHeader">


      However, even though the WSDL defines that the header IS required, i can quite happily push a message through the SOAP binding into my service without any soap header element at all.


      So does switchyard's SOAP binding respect the 'required' element?  and if not, how could I go about overriding this behaviour as this is a requirement from a client, that the header be mandatory.