The remote server returned an unexpected response: (413) Request Entity Too Large

Posted by user1583591 on Stack Overflow See other posts from Stack Overflow or by user1583591
Published on 2012-08-08T04:58:06Z Indexed on 2013/07/02 11:05 UTC
Read the original article Hit count: 831

Filed under:
|

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!

© Stack Overflow or respective owner

Related posts about wcf

Related posts about wcf-binding