Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

.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);
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #core #add #header #soap #request
ADD COMMENT
Topic
Name
2+1 =