views:

284

answers:

3

I'm getting the following runtime error when I added service reference to my website.

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.

There should be no limit while transferring message. So, how can I give the maximum message size?? Wat is the maximum size I can give??

Following is the code:

<httpTransport manualAddressing="false" maxBufferPoolSize="524288"
      maxReceivedMessageSize="65536" allowCookies="false" authenticationScheme="Anonymous"
      bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
      keepAliveEnabled="true" maxBufferSize="65536" proxyAuthenticationScheme="Anonymous"
      realm="" transferMode="Buffered" unsafeConnectionNtlmAuthentication="false"
      useDefaultWebProxy="true" />
+1  A: 

Increase maxBufferSize="65536" and maxReceivedMessageSize="65536" to allow for your longest message.

Of interest: Addressing MaxReceivedMessageSize issues

Mitch Wheat
Already, added with that values only. ??!!
Nila
Sergey
Added maximum size. Then too, it is showing same error :-(
Nila
+1  A: 

I think its not a good idea to use the maximum buffer and message size for transfer because you can always overrun them if your message size is not fixed. I would suggest that you fix you message size to something like 4K or 8K and send data in chunks (if you have large amount of continuous data to be transferred). If your message has multiple lines that vary from 200 to 500 chars then you can fix the number of lines of data you want to transfer at once.

One such example can be an Windows Service processing thousands of connections per second and a Monitor application showing the status of each message processed by the service.

A9S6
I tried.. No use.. Same Error
Nila
What did you try? What is your current message size? Make sure you are using the correct binding.
A9S6
"This factory buffers messages, so the message sizes must be in the range of an integer value.Parameter name: bindingElement.MaxReceivedMessageSize"This is the error occurs when I gave maximum size for that parametermaxBufferSize="999999999" maxBufferPoolSize="524288" maxReceivedMessageSize="9223372036854775807"
Nila
A: 

I cannot give maximum size. I can able to give the size 819222. It is working for me now..

Nila