Tuesday, January 27, 2009

Bad request = MaxReceivedMessageSize exceeded

Continuation from two previous posts on the subject.

I forgot to write about the first reason I got "Bad Request". After tracing the message I found the "real" reason:

“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.”

The default value of the property MaxReceivedMessageSize on WsHttp binding is 65535 bytes. My message was much bigger than that so after increasing the value everything went well.

No comments: