Suppressing mustUnderstand validation on unknown SoapHeaders
For a WCF service or client proxy, it is common to receive SoapHeaders within the coming request or returned response messages. SoapHeader has a mustUnderstand attribute that indicates to the target endpoint (or intermediate message processor) whether the SoapHeader must be processed. The following screenshot shows a typical SOAP message that contains a SoapHeader with the mustUnderstand
attribute set to 1
(true).
Also for a XML Web Service or WCF service, we can dynamically insert SoapHeaders at runtime or statically apply them at design-time (which will be described via WSDL or service metadata).
By default, a WCF endpoint will perform validation on all the SoapHeaders within incoming messages, and if there are any unknown SoapHeaders (not predefined) which have a mustUnderstand
attribute as 1
(or true), a validation exception will be raised by the runtime. However, sometimes it is useful to suppress this validation so that the...