views:

214

answers:

1

I'm calling a web service from a console app - all in C# on .NET.

I want to add an HTTP header (not a SOAP header) to the web service call. How do I do this?

This is what my code looks like so far:

EatService es = new EatService(); // web service added in Web References
// Add HTTP header X-Info = "extra info" here
string info = es.GetMoreInfo(); // ws call
+1  A: 

If you are using an ASMX web service proxy (Web Reference), then this is a duplicate of Adding Custom Http Headers to C# Web Service Proxy.

John Saunders