WSE 2 .Net 1.1 客户端从 LAN 内部调用互联网上的服务。 如何设置代理服务器?
您好,我正在尝试连接到 WSE2 Web 服务(.Net 1.1) 在互联网上 客户端(也是.Net 1.1)位于我公司的 LAN 内,必须通过代理服务器连接到互联网。
当我使用生成的代理进行 WSE2 调用时,它失败并出现以下 Microsoft.Web.Services2.AsynchronousOperationException。
WSE101:异步操作引发异常。
当我调试它时,出现内部异常 System.Net.WebException
底层连接已关闭:无法连接到远程服务器。
我的第一个想法是代理服务器没有在客户端代理中设置,这是我在使用 asmx Web 服务时遇到的问题。
然而,当我查看从 SoapClient 继承的代理代码时,没有明显的方法来设置代理。
有人有什么想法吗?
谢谢
Hi I am trying to connect to a WSE2 web service (.Net 1.1)
on the internet
The client (also .Net 1.1) is inside my company LAN and has to go out through a proxy server to the internet.
When I make the WSE2 call with the generated proxty it fails with the following Microsoft.Web.Services2.AsynchronousOperationException.
WSE101: An asynchronous operation raised an exception.
When I debug it there is an innerexception System.Net.WebException
The underlying connection was closed: Unable to connect to the remote server.
My first thought was that the Proxy server was not set in the client proxy, That being a problem I have had with asmx web services.
However when I look at the proxy code, which inherits from SoapClient there is no obvious way to set the proxy.
Does anybody have any thoguhts?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
客户端代理通常继承自 HttpWebClientProtocol。 从 .Net 1.0 开始,该类就具有 Proxy 属性。 因此,您只需构建适当的代理:
Client Proxy normally inherits from HttpWebClientProtocol. This class has Proxy property since .Net 1.0. So, you simply have to construct appropriate Proxy: