0

我有一些问题。

问题是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> 

附言。临时修改TestService

请任何人。

谢谢。

哦抱歉,“电压”发生错误

我试图增加最大尺寸和长度。

但是,它并没有解决这个问题。

来人帮帮我。

4

1 回答 1

2

如果没有看到您的服务器端配置,将很难帮助您进行故障排除。

话虽如此,要获得真正的底层异常(您没有看到真正发生的事情),您可以做的一件事是配置 WCF Tracing。只需将该配置片段放入服务器端的配置文件中,然后查看生成的日志。那应该指出真正的问题。完成后请务必将其取出。

于 2011-04-11T13:06:19.960 回答