简体   繁体   English

WCF通信异常

[英]WCF Communication Exception

An error occurred while receiving the HTTP response to http://production/Services/AccountService.svc . 接收到http://production/Services/AccountService.svc的HTTP响应时发生错误。 This could be due to the service endpoint binding not using the HTTP protocol. 这可能是由于服务端点绑定不使用HTTP协议。 This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). 这也可能是由于服务器中止HTTP请求上下文(可能是由于服务关闭)。 See server logs for more details. 请参阅服务器日志以获取更多详

What could be the reason for this exception? 这个例外的原因是什么? I have exception details enabled on my ASP.NET site web.config file, where I host the WCF service. 我在我的ASP.NET站点web.config文件中启用了异常详细信息,我在其中托管WCF服务。

I have a second service that's just for testing purposes that just returns an int, which works flawlessly. 我有第二个服务,仅用于测试目的,只返回一个完美无缺的int。

Also, in development, meaning both the consuming and the service application are on the same local computer, both services work. 此外,在开发中,意味着消费和服务应用程序都在同一台本地计算机上,两种服务都有效。 Which makes testing for this error that much harder :( 这使得测试这个错误更加困难:(

Any advice as to how to debug in this particular situation? 关于如何在这种特殊情况下进行调试的任何建议?

I feel your pain with WCF's lack of useful exception detail. WCF缺乏有用的异常细节让我感到痛苦。 What you need to do is enable tracing which provides in-depth debugging information. 您需要做的是启用跟踪,提供深入的调试信息。

Have a look at the Recommended Settings for Tracing and Message Logging on MSDN... 在MSDN上查看推荐的跟踪和消息记录设置 ...

I had that sort of error when I tried to send large data structures over a webservice. 当我尝试通过Web服务发送大型数据结构时,我遇到了这种错误。 The type being marked as [Serializable] , it passed compilation of the WCF web service and the corresponding client without problems. 该类型被标记为[Serializable] ,它传递了WCF Web服务和相应客户端的编译没有问题。 I removed that type, and it would answer just fine. 我删除了那种类型,它会很好地回答。

From what I see this is client site error. 从我看到这是客户端站点错误。 Looks like your WCF service failed and did not responded to the client, and client gave you this error message. 看起来你的WCF服务失败并且没有响应客户端,客户端给你这个错误消息。 Check your trace on the server side. 检查服务器端的跟踪。 Also if this is long running task change your sendTimeout to longer time. 此外,如果这是长时间运行的任务,请将您的sendTimeout更改为更长的时间。 I think by default it is 30 or 60 seconds, so if your process running more than that you will have this type of error. 我认为默认情况下它是30或60秒,所以如果你的进程运行超过你将有这种类型的错误。

Hope this will help. 希望这会有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM