远程服务器返回错误:(407)需要代理身份验证。

远程服务器返回错误:(407)需要代理身份验证。

问题描述:

我在调用Web服务的应用程序上工作。实际上它是https网络服务。当我通过IE或其他浏览器调用Web服务的方法时,它完美无缺。我写了win表单应用程序来连接Web服务。结果我得到"远程服务器返回错误:(407)需要代理验证。"错误。所有呼叫我的环境都是通过代理进行的。 application.config文件中的几行解决了这个问题:

< system.net >
<
defaultProxy 启用 = " 真跨度>的&QUOT; useDefaultCredentials = " true " />< / system.net >

但我需要从"服务器"调用Web服务。我申请的一部分。服务器部分在IIS下运行。当我从我的"服务器"调用https Web服务时,错误返回。 winform的修复不起作用。

有任何建议吗?

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

But I need to call to the web service from a "server" part of my application. The server part runs under IIS. And when I call to https web service from my "server", the error returns back. The fix for a winform does not work.

Any advice?

ASP.NET中的等效配置文件是 web.config 。将该信息放在您网站的web.config中,它将生效。请参阅 http://msdn.microsoft.com/en-us/library/ms178683.aspx etc(你可以把它放在全局的machine.config文件中,但这可能有点粗糙......)
The equivalent config file in ASP.NET is web.config .  Put that information in the web.config for your website and it will take effect.  See http://msdn.microsoft.com/en-us/library/ms178683.aspx etc  (You could instead put in in the global machine.config file, but that may be a bit crude...)