Answers for ".net core add header to soap request"

C#
1

.net core add header to soap request

//initialize your service client  
using (OperationContextScope ocs=new OperationContextScope(client.InnerChannel))
    {
        var requestProp = new HttpRequestMessageProperty();
      	request.Headers.Add("yourheadername", "header value");
        OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = requestProp;
        //call action ... var result = client.OpAsync();
        // Console.WriteLine(result.Result);
    }
Posted by: Guest on February-04-2021

C# Answers by Framework

Browse Popular Code Answers by Language