Aishwarya Shiva
Aishwarya Shiva

Reputation: 3406

"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?

Upvotes: 6

Views: 8016

Answers (3)

KristoferA
KristoferA

Reputation: 12397

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

Upvotes: 2

Rahul Tripathi
Rahul Tripathi

Reputation: 172438

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.

Upvotes: 1

Yaron Naveh
Yaron Naveh

Reputation: 24406

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

Upvotes: 6

Related Questions