1

If anyone can help me figure out why I am getting the following error when making a call to my WCF service I would be eternally grateful.

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 have tried modifying the config file on both the service and client, and made sure the service name includes the namespace. I cannt seem to make any progress.

Here is my service config settings:

<services>
      <service name="CCC.CA-CP &amp; Sightlines Campus Carbon Calculator">
        <endpoint address="" binding="basicHttpBinding" bindingConfiguration="Binding2" contract="CCC.ICCCService" behaviorConfiguration="WebBehavior2" />

      </service>

    </services>
    <bindings>
      <basicHttpBinding>
        <binding name="Binding2" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false"
          hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647"
          maxBufferPoolSize="52428800" maxReceivedMessageSize="2147483647" messageEncoding="Text"
          textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="16384"
            maxBytesPerRead="20000" maxNameTableCharCount="16384" ></readerQuotas>

        </binding>
      </basicHttpBinding>

    </bindings>

..
     <dataContractSerializer maxItemsInObjectGraph="12097151"  />
...
       <requestLimits maxAllowedContentLength="157286400" />
... 
<httpRuntime  useFullyQualifiedRedirectUrl="true" maxRequestLength="2147483647"...

I also set the client config with the same binding values.

Here is the service contract :

namespace CCC
{
    [ServiceContract(Name = "CA-CP & Sightlines Campus Carbon Calculator", Namespace = "http://www.sightlines.com/CCC/01")]
    public interface ICCCService
    {

....
}

Thanks in advance for any help given!

abatishchev
  • 98,240
  • 88
  • 296
  • 433
user1583591
  • 11
  • 1
  • 2
  • You need to change the readerQuotas and other settings both on client and server side – Rajesh Aug 08 '12 at 08:40
  • Possible duplicate of [The remote server returned an unexpected response: (413) Request Entity Too Large.](http://stackoverflow.com/questions/20575946/the-remote-server-returned-an-unexpected-response-413-request-entity-too-larg) – abatishchev Apr 22 '16 at 00:14

1 Answers1

0

The name attribute of the service tag had did not have the name of the class implementation. It had the name in the "ServiceContract" attribute for the service interface. Thank you to Vinay Kumar for the suggestion.

user1583591
  • 11
  • 1
  • 2