The maximum message size quota for incoming messages exceeded exception in WCF
May 24, 2012 2 Comments
This is a common error you get when developing you are consuming WCF service operation that deals with large data.
To overcome this error you need to customize the bindings, service behavior and endpoint behavior of the service.
- Customize the binding:
First of all you need to set the maxbufferpoolsize and maxReceivedMessageSize in the binding.
MaxBufferPoolSize gets or sets the maximum size of any buffer pools used by the transport. The default is 524,288 bytes.
MaxReceivedMessageSize gets and sets the maximum message size that can be receivied. The default is 65536 bytes.
ReaderQuotas: Defines the contraints on the complexity of SOAP messages that can be processed by endpoint configured with a binding. You need to set the maxBytesPerRead, maxDepth, maxNameTableCharCount,maxStringContentLength.