[ACCEPTED]-adding http headers in call to SoapHttpClient service-soaphttpclientprotocol

Accepted answer
Score: 45

It figures that 30 minutes after posting 4 I would stumble across the answer. While 3 the proxy class decelaration does not create 2 a GetWebRequest method, its base class System.Web.Services.Protocols.SoapHttpClientProtocol 1 has it and it can be overridden.

protected override System.Net.WebRequest GetWebRequest(Uri uri)
{
    var request = base.GetWebRequest(uri);
    request.Headers.Add("blah", "blah"); // <----
    return request;
}

More Related questions