[英]WCF service errors out on other machines in the same network
我開發了使用WCF服務的C#控制台應用程序。 在本地計算機上一切正常。 當我創建設置文件並分發exe和exe.config文件時,應用程序會在同一網絡上的其他計算機上出錯,並顯示以下錯誤:
通信對象System.ServiceModel.Channels.ServiceChannel不能用於通信,因為它處於故障狀態。
WCF服務終結點URL- http://inblrlwssc251.wdf.corp:7980 / AfariaService / Server也可以從其他計算機訪問。 不確定會出什么問題。
該服務的配置如下所示,我使用WSHTTP綁定:
<system.serviceModel>
<diagnostics>
<messageLogging logEntireMessage="true" logMalformedMessages="true"
logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<bindings>
<netNamedPipeBinding>
<binding name="NetNamedPipeBinding_IServerService" />
</netNamedPipeBinding>
<netTcpBinding>
<binding name="NetTcpBinding_IServerService">
<security mode="Message" />
</binding>
</netTcpBinding>
<wsHttpBinding>
<binding name="WSHttpBinding_IServerService" />
</wsHttpBinding>
</bindings>
<!--
Modify the "adress" in each of the endpoint tags based on where the Afaria API service is hosted
-->
<client>
<endpoint address="http://inblrlwssc251:7980/AfariaService/Server"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IServerService"
contract="AfariaServerService.IServerService" name="WSHttpBinding_IServerService">
</endpoint>
<endpoint address="net.tcp://inblrlwssc251:7982/AfariaService/Server"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IServerService"
contract="AfariaServerService.IServerService" name="NetTcpBinding_IServerService">
</endpoint>
<endpoint address="net.pipe://localhost/AfariaService/Server"
binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_IServerService"
contract="AfariaServerService.IServerService" name="NetNamedPipeBinding_IServerService">
</endpoint>
</client>
</system.serviceModel>
任何幫助或在正確方向上的指點將不勝感激。
我知道這很舊,您說它已解決,但是為了后代,這通常不是傳遞不正確憑據的結果。 通常,這是服務器響應的結果,其中服務器響應您配置為在緩沖區中接受的更多數據,超過了maxitemsinobject圖,或者服務器響應時間過長(導致異常),該異常會得到處理。 ..並且此異常是下一次調用的結果(如fejesjoco和Tim所指出的)。
發生這種情況時,最好重新初始化client / serviceclient對象(對於此api,也請調用initContext),然后重試該調用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.