Web 服务失败,直到用 IE 访问该 URL

发布于 2024-12-14 07:06:33 字数 1795 浏览 1 评论 0原文

我们有一个访问多个 Web 服务的 WinForms 应用程序 (.NET 4.0/C#)。我们部署到一个在其防火墙上具有某些代理功能的客户端(客户端计算机上的“Internet 选项”中没有代理设置,但它肯定是一个代理)。

问题是,我们的 WinForms 应用程序将在第一次 Web 服务调用时失败。错误信息不是很有用,但很明显它无法调用 Web 服务方法。奇怪的是,一旦我们将 Web 服务 (asmx) URL 放入该客户端计算机上的 Internet Explorer 中,它就可以正常工作几天。这就好像 IE 使路由器缓存了一些路由信息。

还有其他人经历过吗?我们可以实施一个简单的修复吗?

谢谢你!

这是异常信息:

Description: The process was terminated due to an unhandled exception.
Exception Info: System.Net.WebException
Stack:

Server stack trace: 
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at     AutoUpdater.Module.WebService.AutoUpdaterWebService.AutoUpdater.ValidateInstallKey(String installKey, String computerIdentifier)
   at AutoUpdater.Module.WebService.Config.ValidateInstallKey()
   at AutoUpdater.Module.RemoteService.ValidateInstallKey()
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessage)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(System.Runtime.Remoting.Proxies.MessageData ByRef, Int32)
   at AutoUpdater.Foundation.Interfaces.IRemoteService.ValidateInstallKey()
   at AutoUpdater.UpdateForm..ctor()
   at AutoUpdater.Program.Main()

We have a WinForms application (.NET 4.0/C#) that accesses several web services. We deployed to a client who has some proxy feature on their firewall (no proxy settings in Internet Options on the client machine, but it definitely IS a proxy).

The problem is, our WinForms app will fail on the first web service call. The error information isn't very useful but it's clear that it's unable to call the web service methods. The weird part is, once we put the web service (asmx) URL in Internet Explorer on that client machine, it works just fine for several days. It's as if IE is causing the router to cache some of the routing information.

Has anyone else experienced this? Is there a simple fix that we could implement?

Thank you!

Here is the Exception information:

Description: The process was terminated due to an unhandled exception.
Exception Info: System.Net.WebException
Stack:

Server stack trace: 
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   at     AutoUpdater.Module.WebService.AutoUpdaterWebService.AutoUpdater.ValidateInstallKey(String installKey, String computerIdentifier)
   at AutoUpdater.Module.WebService.Config.ValidateInstallKey()
   at AutoUpdater.Module.RemoteService.ValidateInstallKey()
   at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
   at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg, Int32 methodPtr, Boolean fExecuteInContext)
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(System.Runtime.Remoting.Messaging.IMessage, System.Runtime.Remoting.Messaging.IMessage)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(System.Runtime.Remoting.Proxies.MessageData ByRef, Int32)
   at AutoUpdater.Foundation.Interfaces.IRemoteService.ValidateInstallKey()
   at AutoUpdater.UpdateForm..ctor()
   at AutoUpdater.Program.Main()

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文