7
I created a project for ASP NET where I want to get the data of an address from the zip code by calling the url on a webservice.
On my machine works normally, but on the machine I work, there is a need for network authentication. When I give the Submit in the form, the exception is triggered with the following message:
Remote server returned an error: (407) Proxy Authentication Required.
Below is the code I tried to use to make the connection from other Stackoverflow gringa solutions, but without success:
WebClient webClient = new WebClient();
webClient.Proxy = new WebProxy("XX.XX.XX.XXX", 999);
webClient.Credentials = new NetworkCredential("XXXXX", "*********");
I appreciate the help!
Together with this answer: http://codigosfontes.blogspot.com.br/2011/05/obtendo-o-html-de-uma-pagina-com-c.html and this: http://stackoverflow.com/questions/954635/the-servicepointmanager-does-not-support-proxies-of-scheme your solution was simple and solved my problem. However I could not obtain the data using the Webclient object, theoretically more practical, stating that an error occurred in Webclient(); Know something about it?
– user21846
You could not run without the last function because you are implementing an interface (contract), when you do this you are required to write the methods it declares. Read more on https://msdn.microsoft.com/en-us/library/87d83y5b.aspx and https://msdn.microsoft.com/en-us/library/ms173156.aspx. I will edit out the answer to explain better the
.config
.– Marcus Vinicius
As for the Webclient, I suggest opening another question with your specific problem.
– Marcus Vinicius