ASP.NET Exception: The remote name could not be resolved: 'apiconnector.com'

62,840

I finally managed to get this working, with the help of a colleague. The problem only occurs in specific conditions, in my case, this was on my development machine as part of a company domain. The domain uses a proxy server to manage web requests/responses. It turns out that our proxy server was blocking responses from apiconnector.com hence the exception; In addition to that we had to adjust the proxy settings in Internet Explorer as this provides the default settings in Visual Studio too (when configured correctly).

I cannot specify what was changed in terms of the proxy settings, as I stated, I was helped by a colleague; he managed this part of the resolution; However that only solved half of the problem...the exception was still occurring with Visual Studio, however the addition of the following XML to the web.config file resolved everything, and now it works!

<system.net>
  <defaultProxy enabled="true" useDefaultCredentials="true">
  </defaultProxy>
</system.net>
Share:
62,840
Matthew Layton
Author by

Matthew Layton

Passionate about programming, technology and DLT.

Updated on July 05, 2022

Comments

  • Matthew Layton
    Matthew Layton almost 2 years

    As the title suggests, I'm getting the following exception from an ASP.NET page

    The remote name could not be resolved: 'apiconnector.com'

    I can however navigate to this address from a browser, so I know it's accessible.

    Why can't ASP.NET navigate to this address?

    EDIT: How am I "navigating" exactly?

    Ok so basically I've imported a WSDL as a service reference. All I am doing is calling the methods from the service reference. It's the service reference that does the actual navigation.

    Service reference configuration contains the following XML

      <endpoints>
        <endpoint ... address="http://apiconnector.com/API.asmx" ... />
      </endpoints>