locked
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. RRS feed

  • Question

  • 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.

    Server stack trace:
       at System.ServiceModel.Channels.HttpInput.ThrowMaxReceivedMessageSizeExceeded()
       at System.ServiceModel.Channels.HttpInput.GetMessageBuffer()
       at System.ServiceModel.Channels.HttpInput.ReadBufferedMessage(Stream inputStream)
       at System.ServiceModel.Channels.HttpInput.ParseIncomingMessage(Exception& requestException)
       at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)
       at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
       at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
       at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]:
       at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
       at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
       at IService1.getTbOutDetails2(String Fdate, String Tdate)
       at Service1Client.getTbOutDetails2(String Fdate, String Tdate)

    Inner Exception:
    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.

    this is my web.config file

    <?xml version="1.0"?>
    <configuration>

      <system.web>
        <compilation debug="true" targetFramework="4.0" />
      </system.web>
      <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="ObjectServicePortBinding" closeTimeout="10:01:00" openTimeout="10:01:00" receiveTimeout="10:10:00" sendTimeout="10:01:00" allowCookies="false"
                     bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
                     messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
              <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
              <security mode="None">
                <transport clientCredentialType="None" proxyCredentialType="None" realm="" />
                <message clientCredentialType="UserName" algorithmSuite="Default" />
              </security>
            </binding>    
          </basicHttpBinding>
        </bindings>
       
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
              <serviceMetadata httpGetEnabled="true"/>
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="false"/>
              <dataContractSerializer maxItemsInObjectGraph="2147483647" />
              <serviceThrottling maxConcurrentSessions="2147483647" maxConcurrentInstances="2147483647" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
      </system.serviceModel>
     <system.webServer>
        <modules runAllManagedModulesForAllRequests="true"/>
      </system.webServer>
     
    </configuration>

    Wednesday, May 2, 2012 11:21 AM

Answers

  • Well there are two WCF config files you have to work with, and one is on
    the client-side and the other one is on the service-side.
     
    It looks like you are only changing the client--side and not the
    service-side. It's a two way street the client needs  to be able to
    send/receive data and so does the service-side.
     
    You need to create a custom binding on the service-side to override the
    default settings on the service. The custom binding  needs to have the
    same setting as on the client-side.
     
     
    Wednesday, May 2, 2012 2:21 PM

All replies

  • Well there are two WCF config files you have to work with, and one is on
    the client-side and the other one is on the service-side.
     
    It looks like you are only changing the client--side and not the
    service-side. It's a two way street the client needs  to be able to
    send/receive data and so does the service-side.
     
    You need to create a custom binding on the service-side to override the
    default settings on the service. The custom binding  needs to have the
    same setting as on the client-side.
     
     
    Wednesday, May 2, 2012 2:21 PM
  • Please use the same reader quotas setting both on client and server side config files.

    Rajesh S V

    Wednesday, May 2, 2012 2:49 PM
  • And also make sure that you apply the name of basicHttpBinding 'ObjectServicePortBinding' to the bindingconfiguration of endpoint in the server and client side configuration file, also increase the maximum size to 2147483647.

    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

    Thursday, May 3, 2012 7:10 AM