WCF 超时(HTTP 请求已中止/无端点侦听)
我正在修改 WCF 服务以增加 Silverlight 客户端的超时。在修改超时之前,我看到 CommunicationObjectAborted 异常(对 [URL] 的 HTTP 请求已中止)。起初我只修改了WCF的web.cofig,没有效果。然后我关注了这篇文章(http://blog.ecofic.com/?p=379 )并编辑了 ServiceReferences.ClientConfig 。现在我看到了无端点异常。该异常不是在客户端连接到WCF后立即抛出的,而是在连接到WCF后大约1分钟后抛出的。我怀疑这与超时有关?
我在两个配置文件中将打开、关闭、发送和接收超时设置为 5 分钟。
有什么想法吗?谢谢!
I was modifying a WCF service to increase the timeout for a Silverlight client. Before modifying the timeouts I'm seeing CommunicationObjectAborted exception (The HTTP request to [URL] was aborted). At first I only modified the web.coffig of the WCF and it had no effect. I then followed this post (http://blog.ecofic.com/?p=379) and edited ServiceReferences.ClientConfig as well. Now I'm seeing a No endpoint exception. The exception was not thrown immediately after the client connects to WCF, but after about 1 minute after it connected to WCF. I suspect it has something to do with the timeouts?
I set open, close, send and receive timeouts to 5 minutes in both config files.
Any idea? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如 Richard 指出的,sendTimeout 只需要在客户端(在本例中为 Windows Phone 应用程序)上设置。仔细检查 ServiceReferences.clientConfig,因为手动添加的值可能会被 Visual Studio 覆盖。
您也可以检查 这篇文章介绍在 Windows Phone(模拟器)上使用 Fiddler。
As Richard pointed out, sendTimeout only be needed to set on the client (your Windows Phone app in this case). Double check the ServiceReferences.clientConfig as manually added value might get overwritten by Visual Studio.
Also you can check this post for using Fiddler on Windows Phone (emulator).
您应该使用 Fiddler 来分析应用程序执行的请求。这样,您将能够知道请求发送时发生了什么,到底发送到哪里(如果已发送)以及来自服务器的响应代码。
获取这些信息是解决问题的第一步。
You should use Fiddler to analyse the requests performed by your application. This way, you will be able to know what happen when the request is sent, where exactly it is sent (if it is sent), and the response code from the server.
Obtaining these informations is the first step on the way to troubleshoot your issue.