开发者

Modify SOAP header Mustunderstand attribute in WCF client

开发者 https://www.devze.com 2023-01-24 16:24 出处:网络
I am writing a WCF client for a service (not WCF). Gettingan error that Unprocessed \'mustUnderstand\' header element: {http://www.w3.org/2005/08/addressing}Action, because request SOAP contains heade

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 transport开发者_C百科Element = new HttpsTransportBindingElement();
        transportElement.AuthenticationScheme = AuthenticationSchemes.Basic;

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

        var binding = new CustomBinding(messegeElement, transportElement);
        return binding;


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)


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

0

精彩评论

暂无评论...
验证码 换一张
取 消