日期:2014-05-17  浏览次数:21042 次

WCF调用maxReceivedMessageSize属性设置
不管 怎么设置  都报错“已超过传入消息(65536)的最大消息大小配额。若要增加配额,请使用相应绑定元素上的 MaxReceivedMessageSize 属性。”


服务端:


  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <!--DBService-->
        <behavior name="Web.Web.DBServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_DBService" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
          <readerQuotas  maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
        </binding>
      </basicHttpBinding>
    </bindings>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
    
    <services>
      <service behaviorConfiguration="Web.Web.DBServiceBehavior" name="Web.Web.DBService">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_DBService" contract="Web.Web.DBService"/>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
      </service>
    </services>
  </system.serviceModel>
</configuration>




客户端

<configuration>
    <system.serviceModel>
      
        <bindings>
          
            <basicHttpBinding>
                <binding name="BasicHttpBinding_DBService" maxBufferSize="2147483647"
                    maxReceivedMessageSize="2147483647">
                 
                    <security mode="None" />
                </binding>
            </basicHttpBinding>
       &n