【问题标题】:Calling a WSE web-service though a proxy通过代理调用 WSE Web 服务
【发布时间】:2008-10-25 23:54:39
【问题描述】:

我正在使用 Web Services Enhancements 3.0 从使用 Visual Studio 2005 用 C# 编写的 ASP.NET 应用程序调用 Web 服务。

如果我将网络连接设置更改为使用特定的 SOCKS5 代理,我可以在 Internet Explorer 中调用网络服务,但从 .ASPX 页面我收到一条错误消息,告诉我应该使用代理。

您知道如何配置 Web 服务客户端以使用代理吗?

谢谢

PS:

将以下内容添加到 Web.config 不起作用:

<system.net>
  <defaultProxy>
    <proxy proxyaddress="http://theproxy:8080" bypassonlocal="True" />
  </defaultProxy>
</system.net>

【问题讨论】:

  • WSE 已过时。所有新的 Web 服务工作都应使用 WCF 完成,现有的 WSE 代码应尽快迁移或停用。

标签: web-services proxy wse


【解决方案1】:

您需要将 defaultProxy 元素的“启用”属性设置为“真”才能使其工作:

<system.net>
  <defaultProxy **enabled="true"**>
    <proxy proxyaddress="http://theproxy:8080" bypassonlocal="True" />
  </defaultProxy>
</system.net>

这应该可行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-30
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多