【问题标题】:How to resolve WCF CommunicationException was unhandled如何解决 WCF CommunicationException 未处理
【发布时间】:2011-04-11 12:37:12
【问题描述】:

我有一些问题。

问题是CommunicationException 错误。

错误信息是

接收时发生错误 HTTP 响应 http://localhost:18080/WCFServices/TestService。 这可能是由于服务 不使用 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 是临时修改的

请任何人。

谢谢。

抱歉,“电压”发生错误

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

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

谁来帮帮我。

【问题讨论】:

  • 请向我们展示您的服务器配置文件。
  • 如果您发布代码、XML 或数据示例,在文本编辑器中突出显示这些行并单击编辑器上的“代码示例”按钮 ({ })工具栏以很好地格式化和语法突出显示它!如果您发布错误消息,使用块引号 (` " ` ) 正确格式化错误消息。

标签: wcf wshttpbinding communicationexception


【解决方案1】:

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-11-17
    • 2021-09-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多