I am getting this error in my asp.net webservice on the web side (client):
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.
How can I increase the message size so that I don't get this error?
Is it a good practice to keep the message size more than you need to prevent this?

1 answers
Hi
first of all have you calculated the byte site of the messages being received?
for instance if you know they will be around 1.8 mb (1887436 bytes) then you would set this up as 2097152 to give a small amount of available overhead; which is then setup on the binding endpoint in the exe.config file / service.config file.
It is also widely stated that you should not set the max size to a much larger than required amount as this then presents a subset of issues including exposing your app / service to attack: example average msg size = 2MB you should NOT! then set a endpoint messagesize of 4MB, common sense i guess.
Hope this helps
answered one year ago by:
482