Wednesday, October 9, 2013

maxReceivedMessageSize issue in WCF services



Error: The maximum message size quota for incoming messages (65534) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element. ---> System.ServiceModel.QuotaExceededException: The maximum message size quota for incoming messages (65534) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element


Solution: You see this error whenever you receive data on your binding which is more than the default limit of 65534 bytes. To resolve this issue, do the below steps:

1. Open the web.config
2. Go to the binding configuration for the service you are calling.
3. Add the maxReceivedMessageSize attribute to the binding element and set the value (default is 65536) to any appropriate value, depending on the data you may expect to receive.

No comments:

Post a Comment