题
我正在使用Web Services Enhancements 3.0从使用Visual Studio 2005的C#编写的ASP.NET应用程序中调用Web服务。
如果我将网络连接设置更改为使用特定的SOCKS5代理,我可以在Internet Explorer中调用Web服务,但是从.ASPX页面我收到一条错误消息,告诉我应该使用代理。
您知道如何配置Web服务客户端以使用代理吗?
由于
PS:
将以下内容添加到Web.config不起作用:
<system.net>
<defaultProxy>
<proxy proxyaddress="http://theproxy:8080" bypassonlocal="True" />
</defaultProxy>
</system.net>
解决方案
您需要设置“已启用” defaultProxy元素的属性为“true”使它工作:
<system.net>
<defaultProxy **enabled="true"**>
<proxy proxyaddress="http://theproxy:8080" bypassonlocal="True" />
</defaultProxy>
</system.net>
这应该有用。
不隶属于 StackOverflow