Tuesday, October 4, 2016

Unable to connect to remote server while calling a Webservice

Unable to connect to remote server,Unable to connect to remote server WebService, System.Net.WebException Unable to connect to remote server
I received the following error, while calling a Webservice from an ASP.NET application.

System.Net.WebException: {"Unable to connect to the remote server"}.

Cause:

The internet explorer had the settings of a company proxy server and the application's web.config had no defaultProxy element on it. If the defaultProxy element is empty, the proxy settings from Internet Explorer will be used.


Resolution:

Add the defaultProxy element in web.config and set useDefaultCredentials=true.

<system.net>
    <defaultProxy useDefaultCredentials="true" >
    </defaultProxy>
  </system.net>




No comments:

Post a Comment