views:

817

answers:

1

Hello everyone,

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

+2  A: 

Hey,

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.

AlexDrenea
I think maxReceivedMessageSize only specifies request size correct? How about response size?
George2
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
So, you mean there is no restriction about how much data we response to client's request?
George2
yes, i believe tomasr is right. Thanks for the completion.
AlexDrenea
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