If you want to add custom http header web service calls, there is a simple way to do it in WCF. Here is the code:
MessageHeader header
= MessageHeader.CreateHeader(
"My-CustomHeader",
"http://myurl",
"Custom Header."
);
using (Service1Client client = new Service1Client())
{
using (OperationContextScope scope = new OperationContextScope(client.InnerChannel))
{
OperationContext.Current.OutgoingMessageHeaders.Add(header);
HttpRequestMessageProperty httpRequestProperty = new HttpRequestMessageProperty();
httpRequestProperty.Headers.Add("myCustomHeader", "Custom Happy Value.");
httpRequestProperty.Headers.Add(HttpRequestHeader.UserAgent, "my user agent");
OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = httpRequestProperty;
}
}
Inline Confirmations in JavaScript UI
22 hours ago