通信對象System.ServiceModel.Channels.ServiceChannel 無法用於通信,因為其處於“出錯”狀態。


問題描述:在客戶端站點訪問WCF服務后,在頁面停留時間過長,客戶端站點將會報錯。報錯內容如下:

通信對象System.ServiceModel.Channels.ServiceChannel 無法用於通信,因為其處於“出錯”狀態。

在網上看到的處理方法:

receiveTimeout 盡可能的將值設置大,InactivityTimeout盡可能的要小。

參考內容:

https://social.msdn.microsoft.com/Forums/zh-CN/50454233-5870-49c2-8943-c0c02d558c6f/systemservicemodelchannelsservicechannel-?forum=wcfzhchs

http://blog.csdn.net/sweetwxh/article/details/6738650

<wsHttpBinding>
        <binding name="wsBinding"  maxReceivedMessageSize="900000000"  
                 openTimeout="24:00:00" receiveTimeout="24:00:00" 
                 sendTimeout="24:00:00" >
          <security mode="Message">
            <!--定義消息級安全性要求的類型,為證書-->
            <message clientCredentialType="Certificate" />
          </security>
        </binding>
 </wsHttpBinding>

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM