How to set the MaxReceivedMessageSize programatically when using a WCF Client?
- by Pratt
I want to set the MaxReceivedMessageSize property to some higher limit (Due to (400) Bad Request error) in my client programatically.
This is the code I am using...
WCFServiceTestClient wcfClient =
new WCFServiceTestClient(new wsHttpBinding(), strServiceURL);
My service url is dynamic and hence cannot use the web.config.
//The following code doesnt seem to take effect
((WSHttpBinding)wcfClient.ChannelFactory.Endpoint.Binding)
.MaxReceivedMessageSize = 2147483647;
What am I doing wrong?
Any help is appreciated.
Thanks
Pratt