Wcf-The maximum message size quota for incoming messages (65536) has been exceeded?

You should set maxReceivedMessageSize=”2147483647″ to increase message size. Try to change config to this:

<binding maxBufferSize="2147483647" 
         maxBufferPoolSize="2147483647" 
         maxReceivedMessageSize="2147483647">
    <readerQuotas maxDepth="2147483647" 
                  maxStringContentLength="2147483647" 
                  maxArrayLength="2147483647" 
                  maxBytesPerRead="2147483647"
                  maxNameTableCharCount="2147483647" />
</binding>

But it is a bad practice to increase you message values to max value. This can lead you to serious troubles with DOS leaks.

UPDATED:

<system.serviceModel>
  <bindings>
   <wsHttpBinding>
    <binding name="wsBinding" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647"  >
      <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" />
    </binding>
   </wsHttpBinding> 
  </bindings>
  <services>
  <service name="FileService.Service1" behaviorConfiguration="FileService.Service1Behavior">
  <host>
    <baseAddresses>
      <add baseAddress = "http://localhost:8732/Design_Time_Addresses/FileService/Service1/" />
    </baseAddresses>
  </host>
   <endpoint address ="" binding="wsHttpBinding" bindingConfiguration="wsBinding" contract="FileService.IService1">   
   <identity>
    <dns value="localhost"/>
   </identity>
 </endpoint>

 <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
 </service>
 </services>
 <behaviors>
   <serviceBehaviors>
     <behavior name="FileService.Service1Behavior">    
       <serviceMetadata httpGetEnabled="True"/>    
       <serviceDebug includeExceptionDetailInFaults="False" />
     </behavior>
   </serviceBehaviors>
 </behaviors>
</system.serviceModel>

Leave a Comment