首页 > 其他 > 详细

WCF 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性

时间:2014-10-20 13:19:49      阅读:291      评论:0      收藏:0      [点我收藏+]

我出现这个问题主要是服务器返回数据量过大引起了,需要客户端服务端都要进行配置;我会说其实有神器的么。。。。(工具=>wcf服务配置编辑器),用工具编辑下,就会完全搞定这个问题,再也不用纠结了

服务端配置(有木有很精简):

 <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="NewBinding0" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
            maxReceivedMessageSize="2147483647" />
      </basicHttpBinding>
    </bindings>
    <services>
      <service name="Jinher.AMP.SNS.Service.BP.Service.Neighbor">
        <endpoint address="http://127.0.0.1:8089/neighbor" binding="basicHttpBinding"
            bindingConfiguration="NewBinding0" contract="Jinher.AMP.SNS.Service.BP.IService.INeighbor" />
      </service>
    </services>
  </system.serviceModel>

客户端代码:

 <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="NewBinding0" maxBufferPoolSize="2147483647" maxBufferSize="2147483647"
            maxReceivedMessageSize="2147483647" />
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://127.0.0.1:8089/neighbor" binding="basicHttpBinding"
          bindingConfiguration="NewBinding0" contract="Jinher.AMP.SNS.Service.BP.IService.INeighbor"
          name="OnlineUserService" kind="" endpointConfiguration="">
        <!--<identity>
          <certificateReference storeName="My" storeLocation="LocalMachine"
              x509FindType="FindBySubjectDistinguishedName" />
        </identity>-->
      </endpoint>
    </client>
  </system.serviceModel>

WCF 已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性

原文:http://www.cnblogs.com/shi-meng/p/4036766.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!