I try to connect to a web service hosted on a different server using the WebRequest Class. The web service returns a string as a Response. While doing so I get an Error:
Add new WebProxy() for the proxy setting , where you are creating a web request.
Example :-
string url = "Your URL";
System.Net.WebRequest req = System.Net.WebRequest.Create(url);
req.Proxy = new WebProxy();
System.Net.WebResponse resp = req.GetResponse();
Where req.Proxy = new WebProxy() handle the proxy setting & helps the code to work fine.