Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"The maximum message size quota for incoming messages (65536) has been exceeded.". Even after setting greater size

I am trying to access a WCF service from a Windows Forms client application. My binding config on server is this:

 <bindings>
      <customBinding>
        <binding name="Wrabind" closeTimeout="00:05:00" openTimeout="00:05:00"
            sendTimeout="00:25:00">
          <textMessageEncoding />
          <security authenticationMode="SecureConversation" includeTimestamp="true"
              messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
            <localClientSettings maxClockSkew="00:30:00" />
            <localServiceSettings maxClockSkew="00:30:00" />
            <secureConversationBootstrap messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10">
              <localClientSettings maxClockSkew="00:30:00" />
              <localServiceSettings maxClockSkew="00:30:00" />
            </secureConversationBootstrap>
          </security>
          <httpTransport maxBufferPoolSize="20000000" maxReceivedMessageSize="20000000"
              allowCookies="true" maxBufferSize="20000000" />
        </binding>
      </customBinding>
    </bindings>

As you can see I already set the maxReceivedMessageSize to 20000000, but its still showing "The maximum message size quota for incoming messages (65536) has been exceeded." exception. Am I missing something?

like image 749
Aishwarya Shiva Avatar asked Aug 25 '13 15:08

Aishwarya Shiva


3 Answers

Maybe this error comes from the client and not the server. Make sure same setting exists on the client config.

like image 167
Yaron Naveh Avatar answered Nov 10 '22 07:11

Yaron Naveh


WCF server side settings are irrelevant in this case. Client-side binding config is your enemy ...

like image 2
KristoferA Avatar answered Nov 10 '22 07:11

KristoferA


From here:-

You may need to add the "binding.MaxBufferSize = 2147483647" as well. "ServiceReferences.ClientConfig" will get auto updated once you've updated or re-configured the service reference. Hence if you've provided correct binding configurations at the service level using "App.config" of your WCF service lib, that configuration will get auto inherited to the consuming silverlight client. But all these will not come to effect if you are creating the bindings dynamically in code.

like image 1
Rahul Tripathi Avatar answered Nov 10 '22 09:11

Rahul Tripathi