WCF request/response package size

Go To StackoverFlow.com


I am wondering if there are configurable settings for restriction of the maximum request/respose data package size for WCF? I am using VSTS 2008 + WCF 3.5. I am self-host WCF service as a Windows Service.

thanks in advance, George

2009-06-16 09:53
by George2


Yes, the binding has properties for getting/setting max receive data bytes: check "maxReceivedMessageSize" property (representing the size in bytes).

However, setting this to a big value could not be a good idea since if an error occures in the transport you have to resend the whole (big) message.

Edit: Here you can find details about all binding configuration properties.

2009-06-16 10:03
by AlexDrenea
I think maxReceivedMessageSize only specifies request size correct? How about response size - George2 2009-06-16 10:09
Restricting what you send doesn't make much sense (you can handle that in your own code a lot better). What WCF provides is a way to restrict how much resources receiving a message can consume, not only through the max message size, but also through the reader quotas - tomasr 2009-06-16 12:23
So, you mean there is no restriction about how much data we response to client's request - George2 2009-06-16 13:02
yes, i believe tomasr is right. Thanks for the completion - AlexDrenea 2009-06-16 13:28
Cool, I like your conclusions. A further question, I think there is no max size limitation for self-hosted WCF service, but if we host in IIS, there is limitation, correct - George2 2009-06-16 15:14