📜  .net 核心将标头添加到soap 请求 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:55.857000             🧑  作者: Mango

代码示例1
//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);
    }