Developer404
Developer404

Reputation: 5972

Error when added Service Reference to website

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

Upvotes: 3

Views: 5266

Answers (3)

Developer404
Developer404

Reputation: 5972

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

Upvotes: 0

A9S6
A9S6

Reputation: 6675

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.

Upvotes: 1

Mitch Wheat
Mitch Wheat

Reputation: 300769

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

Of interest: Addressing MaxReceivedMessageSize issues

Upvotes: 1

Related Questions