How to add a custom HTTP header to every WCF call?

后端 未结 13 2472
不知归路
不知归路 2020-11-22 05:33

I have a WCF service that is hosted in a Windows Service. Clients that using this service must pass an identifier every time they\'re calling service methods (because that i

13条回答
  •  情书的邮戳
    2020-11-22 06:21

    var endpoint = new EndpointAddress(new Uri(RemoteAddress),
                   new[] { AddressHeader.CreateAddressHeader(
                           "APIKey", 
                           "",
                           "bda11d91-7ade-4da1-855d-24adfe39d174") 
                         });
    

提交回复
热议问题