1
votes

Issue : The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element

CONFIG File Details.

<services>
  <service behaviorConfiguration="WCFServiceBehavior"
           name="GenServiceLibrary.IFileUploadService">
    <endpoint address="FileUploadService.svc" binding="basicHttpBinding"
              behaviorConfiguration="CoreServiceBehavior"
              bindingConfiguration="WCFServiceBinding" 
              contract="GenServiceLibrary.IFileUploadService"/>
    <endpoint address="mex" binding="mexHttpsBinding" 
              contract="IMetadataExchange"/>
  </service>
  <service behaviorConfiguration="WCFServiceBehavior"
           name="GenServiceLibrary.Service.svc">
    <endpoint address="Service.svc" binding="basicHttpBinding"
              behaviorConfiguration="CoreServiceBehavior"
              bindingConfiguration="WCFServiceBinding"
              contract="GenServiceLibrary.ICommonService"/>
    <endpoint address="mex" binding="mexHttpsBinding" 
              contract="IMetadataExchange"/>
  </service>
</services>
<bindings>
  <basicHttpBinding>
    <binding name="WCFServiceBinding" maxBufferPoolSize="1024000"
             maxBufferSize="1024000" maxReceivedMessageSize="1024000">
      <readerQuotas maxDepth="1024000" maxStringContentLength="1024000"
                    maxArrayLength="1024000" maxBytesPerRead="1024000"
                    maxNameTableCharCount="1024000" />
    </binding>
  </basicHttpBinding>
</bindings>
<behaviors>
  <serviceBehaviors>
    <behavior name="WCFServiceBehavior">
      <serviceMetadata httpsGetEnabled="true" />
      <serviceDebug includeExceptionDetailInFaults="true" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="CoreServiceBehavior">
      <webHttp />
    </behavior>
  </endpointBehaviors>
</behaviors>
1

1 Answers

3
votes

Hard to decipher what your issue really is from what little you’ve posted.

In order to transfer large messages with WCF, you need to make sure that the message quota values are increased in BOTH the client and server configuration files in order to address the issue. Otherwise, the resolution is relatively simple, just adjust the configuration to have higher values.

For example:

<binding name="DefaultBasicHttpBinding" maxBufferPoolSize="1024000" maxBufferSize="1024000" maxReceivedMessageSize="1024000">
  <readerQuotas maxDepth="1024000" maxStringContentLength="1024000" maxArrayLength="1024000" maxBytesPerRead="1024000" maxNameTableCharCount="1024000" />
</binding>