WCF间歇性停止响应

编程入门 行业动态 更新时间:2024-10-24 12:25:06
本文介绍了WCF间歇性停止响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个ASP.Net网站,该网站从WCF托管站点(IIS)获取所有业务逻辑.偶尔,后端WCF似乎冻结了,这使Web前端停止响应.我必须回收两个应用程序池以使其再次运行.

I have a ASP.Net web site that get all business logic from a WCF hosting site (IIS). Once in a while, it looks like the backend WCF frozen and that makes web front-end stop responding. I have to recycle both application pools to make it work again.

  • 最近发生的次数更多,可能是因为我们有更多&使用该网站的更多客户.以前,它每月发生一次,而现在每周一次.也许更多.
  • 在每次SVC通话后,我们都会关闭连接.
  • 回收池后在事件日志中收到错误消息

消息:System.ServiceModel.CommunicationException:收到对.........../.... BusinessServices.svc的HTTP响应时发生错误.这可能是由于服务端点绑定未使用HTTP协议.这也可能是由于服务器终止了HTTP请求上下文(可能是由于服务关闭了).有关更多详细信息,请参见服务器日志. ---> System.Net.WebException:基础连接已关闭:接收时发生意外错误. ---> System.IO.IOException:无法从传输连接中读取数据:现有连接被远程主机强行关闭. ---> System.Net.Sockets.SocketException:现有连接被远程主机强行关闭

Message: System.ServiceModel.CommunicationException: An error occurred while receiving the HTTP response to .........../.....BusinessServices.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

  • Web应用程序的Web.config:
  • <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IBusinessServices" closeTimeout="00:31:00" openTimeout="00:31:00" receiveTimeout="00:10:00" sendTimeout="00:31:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false"> <readerQuotas maxDepth="999" maxStringContentLength="2147483647" maxArrayLength="1638400" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" /> <security mode="Message"> <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" /> <message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" /> </security> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="localhost:8890/MyBusinessServices.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IBusinessServices" contract="MyBusinessServices.IBusinessServices" name="WSHttpBinding_IBusinessServices" /> </client>

      WCF服务的
    • Web.config,将限制设置为1500

      • Web.config of the WCF service, with throttling set to 1500

        ...

        .....

        <behavior name="AppServiceBehaviors"> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> <dataContractSerializer maxItemsInObjectGraph="2147483647" /> <serviceTimeouts transactionTimeout="00:15:00" /> <serviceThrottling maxConcurrentCalls="1500" maxConcurrentSessions="1500" maxConcurrentInstances="2147483647" /> </behavior> <behavior name=""> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> <dataContractSerializer maxItemsInObjectGraph="2147483647" /> </behavior> </serviceBehaviors> </behaviors>

      • 这个问题是断断续续的,但它使我发疯.任何想法/建议都表示赞赏.

        This problem is intermittent but it's driving me crazy. Any ideas/suggestions is appreciated.

        埃里克

        推荐答案

        我给您的2美分,

        服务中止-由于内部发生致命错误而导致的错误,

        Service abort - error due to fatal error occurred inside,

        确保在Dev中的VS IDE中调试WCF时,保留Exceptions(Ctrl D,E),检查所有未处理的异常"列.尽管有CATCHes,这使IDE能够准确地中断应用程序代码行.这将发现任何错误.

        Make sure while debugging WCF in VS IDE in Dev, keep the Exceptions(Ctrl D,E), check all "unhandled exception" columns. This enables IDE to break the application code line exactly, inspite of the CATCHes..this will unearth any bugs.

        如果有任何发现,请告知我们...

        Please do let us know, if any findings here...

        祝你好运, HydTechie

        Good Luck, HydTechie

更多推荐

WCF间歇性停止响应

本文发布于:2023-11-16 15:56:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1605713.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:间歇性   WCF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!