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
This works for me
TestService.ReconstitutionClient _serv = new TestService.TestClient();
using (OperationContextScope contextScope = new OperationContextScope(_serv.InnerChannel))
{
HttpRequestMessageProperty requestMessage = new HttpRequestMessageProperty();
requestMessage.Headers["apiKey"] = ConfigurationManager.AppSettings["apikey"];
OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] =
requestMessage;
_serv.Method(Testarg);
}