Error : Unable to connect to the remote server

I got "Unable to connect to the remote server error" when I tried to call a webservice that is hosted on some remote machine outside my firewall. I am using a proxy server, and figured it that my application is not aware of the proxy server. So I did some googling and add the following defaultproxy settings under System.net tag in applications web.config file.

 
  <system.net>
    <defaultProxy useDefaultCredentials="true"> 
      <proxy proxyaddress="http://Your Proxy Address:PortNumber" bypassonlocal="True" />
    </defaultProxy>
  </system.net>

useDefaultCredentials Specifies whether the default credentials for this host are used to access the web proxy. The default value is false
bypassonlocal Specifies whether the proxy is bypassed for local resources
proxyaddress Specifies the proxy URI to use

To know your proxy address,

  •  Open your WebBrowser and navigate to Internet Options
  •  Under Connections Tab, open LAN Settings and copy Address and Port no.

      Proxy.PNG

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account, used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <p> <span> <div> <h1> <h2> <h3> <h4> <h5> <h6> <img> <map> <area> <hr><br> <br /> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <em> <b> <u> <i> <strong><font> <del> <ins> <sub> <sup> <quote> <blockquote> <pre> <address> <code> <cite> <embed> <object> <param> <strike> <caption>
  • You can enable syntax highlighting of source code with the following tags: <c>, <cpp>, <csharp>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <sql>, <tsql>, <vbnet>, <xml>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Lines and paragraphs break automatically.

More information about formatting options

Who's online

There are currently 0 users and 2 guests online.

Recent Answers

Anonymous added a answer to LC3 Assembly Palindrome Program (3 years 23 weeks ago)
 
Anonymous added a answer to LC3 Assembly Palindrome Program (3 years 23 weeks ago)
 
Anonymous added a answer to Error-GetTypeHashCode()': no suitable method found to override (3 years 40 weeks ago)
 
Anonymous added a answer to AutoIncrement vs UniqueIdentifier (4 years 13 weeks ago)
 
vaibhav added a answer to Linq query on Datatable (4 years 15 weeks ago)
 
vaibhav added a answer to Delete Duplicate Records From a table (4 years 27 weeks ago)