HTTP status 407: Proxy Authentication Required

By pass Proxy when invoking a web service

defaultProxy useDefaultCredentials=true enabled = “False”> Set enabled as False to bypass proxy
<proxy usesystemdefault= False proxyaddress= bypassonlocal=True />

To specify proxy credentials in your code

NetworkCredential credential = new NetworkCredential(“user”, “password”,“domain”);

Service1 _service = new Service1();

_service.PreAuthenticate = true;

_service.Credentials = credential;

_service.Proxy = WebProxy.GetDefaultProxy();

_service.Proxy.Credentials = CredentialCache.DefaultCredentials;

[more details]

Posted in C#. 4 Comments »