2011-04-11 63 views
0

我有一些問題。如何解決WCF CommunicationException未處理

問題是CommunicationException錯誤。

錯誤消息是

在接收到 http://localhost:18080/WCFServices/TestService的 HTTP響應時發生錯誤。 這可能是由於服務 端點綁定未使用HTTP 協議。這也可能是由於 HTTP請求上下文被服務器的 中止(可能由於 服務關閉)。有關更多詳細信息,請參閱服務器 日誌。

我在下面寫的源代碼。

TestServiceClient client = new TestServiceClient(); 
TestSettings[] voltages = client.GetTestSettings(); 

錯誤信息出現在傾斜詞上方。

我想同步主應用程序和客戶端應用程序。

以上錯誤是客戶端應用程序。

我app.config文件是

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.serviceModel> 
    <bindings> 
     <wsHttpBinding> 
     <binding name="WSHttpBinding_ITestService" closeTimeout="00:01:00" 
      openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
      bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" 
      maxBufferPoolSize="524288" maxReceivedMessageSize="209715200" 
      messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" 
      allowCookies="false"> 
      <readerQuotas maxDepth="32" maxStringContentLength="2147483647" 
      maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="16384" /> 
      <reliableSession ordered="true" inactivityTimeout="00:10:00" 
      enabled="false" /> 
      <security mode="None"> 
      <transport clientCredentialType="Windows" proxyCredentialType="None" 
       realm="" /> 
      <message clientCredentialType="Windows" negotiateServiceCredential="true" /> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 
    <client> 
     <endpoint address="http://localhost:18080/WCFServices/TestService" 
     binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ITestService" 
     contract="TestServiceReference.ITestService" 
     name="WSHttpBinding_ITestService" /> 
    </client> 
    </system.serviceModel> 
</configuration> 

PS。 TestService被修改臨時

請任何人。

謝謝。

噢,對不起,在

我試圖增加MAXSIZE和長度「電壓」發生錯誤。

但是,它並沒有解決這個問題。

有人幫助我。

+1

請向我們展示您的服務器配置文件。 – flayn 2011-04-11 12:40:52

+0

如果您發佈代碼,XML或數據樣本,請**在文本編輯器中突出顯示這些行,然後單擊編輯器工具欄上的「代碼樣本」按鈕(「{}」)以精確地格式化和語法突出顯示它!如果您發佈錯誤消息,**請**使用blockquotes('「')正確格式化錯誤消息。 – 2011-04-11 13:07:56

回答

2

沒有看到您的服務器端配置,它將很難幫助您排除故障。

話雖如此,你可以做的事情之一,以獲得真正的底層異常(你沒有看到真正發生的事情)是configure WCF Tracing。只需將該配置代碼片段放在服務器端的配置文件中,然後查看生成的日誌。這應該指出你真正的問題。確保在完成後將其取出。

+0

哦,對不起,在」電壓「上發生錯誤。 – 2011-04-11 23:11:16

相關問題