Click here to Skip to main content
15,884,388 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi all,

My web application consumes a web service with the following code.

System.Net.WebProxy objprox = new System.Net.WebProxy("http://proxyservername:portnumber");
objprox.Credentials = new System.Net.NetworkCredential("username", "password", "domainname");

WebService1 objService = new WebService1();
objService.Proxy = objprox;

But I get the exception as "The request failed with HTTP status 407: Proxy Authentication Required." while using the method form webservice.

Can any one suggest for this.
Posted

Did you try to Google for the error message [^]?

I e.g. found this answer[^], which basically looks like your code, too.

So maybe you are passing the wrong credentials to your proxy server?

Usually, activating detailed logging on the proxy server and inspecting the log file after your request to the web service should help to narrow down the issue.
 
Share this answer
 
Hi,

What you are doing is correct. Were you passing correct credentials to the server and also are you changing the URL of the proxy in your code at later stage? Please do post the fix in case you have got one, so that it would help others.

Regards,
Sushant.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900