0
I am trying to communicate with a web service and my machine uses internet via proxy. When initiating web service communication, proxy authentication error. How can I get the user and password I use for browser? I’m using visual studio 2010 and C#.
Post the code, so you can help.
– Wictor Chaves
I was able to solve it with the following code: Webproxy proxy = new Webproxy(); Uri myUri = new Uri("urlproxy:port"); proxy. Address = myUri; Networkcredential crediciais = new Networkcredential("user", "password"); proxy.Credentials = crediciais; objectWebService.Proxy = proxy;
– Glauco Oliveira
You can answer your own question.
– Wictor Chaves
It is possible to use the default user and password by adding the following code in the app.config <Configuration> <system.net> <defaultProxy enabled="true" useDefaultCredentials="true"> </defaultProxy> </system.net> </Configuration>
– Glauco Oliveira