How to Increase Message Size Quota in WCF Service

When we start using WCF service we generally gets this error message.

"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"

That means message size is less, we have to increase message size quota. this problem occures when we send large dataset as a parameter. to resolve this problem we increase message size like this in web.config or app.config.

<bindings> 
   
<basicHttpBinding> 
       
<binding name="basicHttp" allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000" maxBufferPoolSize="20000000"> 
           
<readerQuotas maxDepth="32" maxArrayLength="200000000" maxStringContentLength="200000000"/> 
       
</binding> 
   
</basicHttpBinding> 
</bindings>
 


Ebook Download
View all
Learn
View all