3

I am writing a WCF client for a service (not WCF). Getting an error that Unprocessed 'mustUnderstand' header element: {http://www.w3.org/2005/08/addressing}Action, because request SOAP contains header with mustunderstand='true'. I have to either set it false or remove the whole header. can you show the way to do that?

Here is the binding code

var transportElement = new HttpsTransportBindingElement();
        transportElement.AuthenticationScheme = AuthenticationSchemes.Basic;

        var messegeElement = new TextMessageEncodingBindingElement();
        messegeElement.MessageVersion = MessageVersion.CreateVersion(EnvelopeVersion.Soap11);

        var binding = new CustomBinding(messegeElement, transportElement);
        return binding;
Amzath
  • 3,159
  • 10
  • 31
  • 43
  • Why do you need to remove the header? What binding are you using in your client? The metioned header is from WS-Addressing which can be also turned on in WCF. – Ladislav Mrnka Nov 13 '10 at 18:38
  • Service did not like the header. Getting this exception System.ServiceModel.ProtocolException: Unprocessed 'mustUnderstand' header element: {http://www.w3.org/2005/08/addressing}Action. Added my custom binding code in the question – Amzath Nov 15 '10 at 16:24

2 Answers2

5

I resolved this one by setting AddressingVersion to None that did not put the SOAP headers.

here is the code

MessageVersion.CreateVersion(EnvelopeVersion.Soap11, AddressingVersion.None)
Amzath
  • 3,159
  • 10
  • 31
  • 43
  • It is many years later and this still seems to be a problem. However, this fix did not work for me. Mustunderstand="1" still exists in my security header. – Jereme Dec 07 '17 at 16:07
1

Specifying the messageVersion solved my problem. <mtomMessageEncoding messageVersion="Soap12"/>