Monday, 11 June 2012

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.

I got this error
"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."
when i received data from the server.
for this problem i set MaxReceivedMessageSize in my client side.


<wsHttpBinding>
    <binding name="test" closeTimeout="00:01:00" openTimeout="00:01:00"
     receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
     transactionFlow="false" hostNameComparisonMode="StrongWildcard"
     maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text"
     textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
(or)


WSHttpBinding binding = new WSHttpBinding();
            binding.MaxReceivedMessageSize = 2147483647;
            EndpointAddress endpointAddress = new EndpointAddress("http://localhost:59167/Service1.svc");
            ServiceReference1.Service1Client sc = new ServiceReference1.Service1Client(binding,endpointAddress);

Hope this helps.

No comments:

Post a Comment