Passing Custom headers from .Net 1.1 client to a WCF service

Posted by sreejith on Stack Overflow See other posts from Stack Overflow or by sreejith
Published on 2010-04-28T02:25:44Z Indexed on 2010/04/28 2:33 UTC
Read the original article Hit count: 435

Filed under:
|
|

I have a simple wcf service which uses basicHttp binding, I want to pass few information from client to this service via custom SOAP header. My client is a .net application targetting .Net 1.1, using visual studio I have created the proxy( Added a new web reference pointing to my WCF service) I am able to call methods in the WCF service but not able to pass the data in message header. Tried to override "GetWebRequest" and added custom headers in the proxy but for some reason when I tried to access the header using "OperationContext.Current.IncomingMessageHeaders.FindHeader" it is not thier.

Any idea how to solve this prob?

This is how I added the headers

protected override System.Net.WebRequest GetWebRequest(Uri uri)

{

HttpWebRequest request; request = (HttpWebRequest)base.GetWebRequest(uri); request.Headers.Add("tesData", "test");
return request;

}

© Stack Overflow or respective owner

Related posts about wcf

Related posts about wcfservice