zoukankan      html  css  js  c++  java
  • 使用WCF服务的客户端出现maxReceivedMessageSize异常

    使用WCF服务的客户端出现maxReceivedMessageSize异常解决方案

        当使用WCF的客户端调取的数据过多时,会出现这个异常。一般情况下,系统默认值是65536,大约容纳100-200条左右的数据。所以建议您在您的项目中,为了避免使用时时期出现这个错误。您应该使用如下解决方案。

        解决方案:在客户端的Config文件中,加入maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"属性。

    如图:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpBinding_ICaseService"  maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"/>
            <binding name="BasicHttpBinding_IEvidenceService"   maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"/>
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://localhost:8537/Service/CaseService.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICaseService"
            contract="CaseService.ICaseService" name="BasicHttpBinding_ICaseService" />
          <endpoint address="http://localhost:8537/Service/EvidenceService.svc"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IEvidenceService"
            contract="EvidenceService.IEvidenceService" name="BasicHttpBinding_IEvidenceService" />
    </client> </system.serviceModel> </configuration>

    再次运行,一切正常。

  • 相关阅读:
    HAProxy+keepalived+MySQL 实现MHA中slave集群负载均衡的高可用
    mysql高可用架构之MHA,haproxy实现读写分离详解
    bootstrap全局css样式
    响应式与bootstrap
    jquery3
    jquery2
    jquery
    client,offset,scroll系列
    javascript-BOM
    JavaScript-DOM续
  • 原文地址:https://www.cnblogs.com/songxingzhu/p/3286708.html
Copyright © 2011-2022 走看看