ASP.NET例外:远程名称无法解析:'apiconnector.com“ [英] ASP.NET Exception: The remote name could not be resolved: 'apiconnector.com'

查看:159
本文介绍了ASP.NET例外:远程名称无法解析:'apiconnector.com“的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

正如标题所暗示的,我是从一个ASP.NET页面获得以下情况例外


  

远程名称无法解析:apiconnector.com


我可以不过导航从浏览器这个地址,所以我知道它是可访问的。

为什么不能ASP.NET导航到这个地址?

编辑:?我如何导航正是

好了,所以基本上我已经导入一个 WSDL 作为服务引用。所有我做的是从调用服务引用的方法。它的服务引用执行实际的导航。

服务引用配置包含以下XML

 <&端点GT;
    <终点......地址=htt​​p://apiconnector.com/API.asmx... />
  < /端点>


解决方案

我终于得到这个工作,与同事的帮助。问题只出现在特定条件下,于我而言,这是我的开发机上作为一个公司域的一部分。该域名使用代理服务器来管理Web请求/响应。事实证明,我们的代理服务器从apiconnector.com的因此例外的拦截响应;此外,我们必须在Internet Explorer中调整代理设置,因为这提供了在Visual Studio中的默认设置太(正确配置时)。

我不能指定哪些是在代理设置条件变了,正如我所说,我被一个同事帮助;他所管理的决议这一部分;但是,这种...异常仍与Visual Studio中出现的问题,不仅解决了一半,但是除了下面的XML到web.config文件解决了一切,而现在它的作品!

 < system.net>
  < defaultProxy启用=真useDefaultCredentials =真>
  < / defaultProxy>
< /system.net>

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>

解决方案

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>

这篇关于ASP.NET例外:远程名称无法解析:'apiconnector.com“的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆