How to add HTTP Header to SOAP Client

前端 未结 3 1852
别那么骄傲
别那么骄傲 2020-12-01 18:32

Can someone answer me if it is possible to add HTTP header to soap client web-service calls. After surfing Internet the only thin I found was how to add SOAP header.

3条回答
  •  余生分开走
    2020-12-01 19:12

    var client = new MyServiceSoapClient();
    using (new OperationContextScope(InnerChannel))
    { 
        WebOperationContext.Current.OutgoingRequest.Headers.Add("myCustomHeader", "myValue");                
    }
    

提交回复
热议问题