2

I have been trying to create a client to a webservice using C#.

To do this, I have used the WSDL link of the webservice to generate proxy classes using Visual Studio 2010. However, to add an Authorization header to the request, I was looking to override GetWebRequest() but I was surprised to find that I was not able to do so. The generated proxy for the web service does not seem to inherit from SoapHttpClientProtocol. Instead, I have something like:

[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.ServiceModel", "4.0.0.0")]
public partial class GeocoderClient : System.ServiceModel.ClientBase<GeocoderClientTest.ServiceReference1.Geocoder>, GeocoderClientTest.ServiceReference1.Geocoder {
...
}

Am I missing something here?

Thanks

SRA
  • 43
  • 3
  • I found this [thread](http://stackoverflow.com/questions/4080986/authorization-header-is-missing-in-http-request-using-wcf). I wasn't sure whether it's a requirement for you to do this **only** by overriding the GetWebRequest() method – Tung Feb 22 '12 at 08:12

0 Answers0