none
Maximum request length exceeded RRS feed

  • Question

  • I have WCF service and client is getting the following error

    Message: Message:

    An error occurred while receiving the HTTP response to http://XXXXXX /MyService/Service.svc. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details.

    Type: CommunicationExceptionStack Trace:

    So I enabled the WCF tracing and it shows error “Maximum request length exceeded.”

    I have the following binding in WCF service

    <system.serviceModel>
        <services>
          <service name="XXXXXXXXXXXX" behaviorConfiguration="ImportServiceBehavior">
            <endpoint name="BasicHttpEndPoint" binding="basicHttpBinding" contract="XXXXXXXXXXXXXXXXXXXX" bindingConfiguration="ImportServiceBasicHttpBinding" />
            <endpoint name="MexHttpEndPoint" address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
          </service>
        </services>
        <bindings>
          <basicHttpBinding>
            <binding name="ImportServiceBasicHttpBinding" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" receiveTimeout="00:30:00">
              <readerQuotas maxStringContentLength="8192" maxArrayLength="20971520" />
              <security mode="None" />
            </binding>
          </basicHttpBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior name="ImportServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" aspNetCompatibilityEnabled="true" />
      </system.serviceModel>
    

    On the client side I have the following

    <system.serviceModel>
        <bindings>
          <basicHttpBinding>
            <binding name="BasicHttpEndPoint" sendTimeout="00:30:00" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" maxBufferPoolSize="2147483647" receiveTimeout="00:30:00">
              <readerQuotas maxStringContentLength="8192" maxArrayLength="20971520" />
            </binding>
          </basicHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://XXXXXX /MyService/Service.svc."
                    binding="basicHttpBinding"
                    bindingConfiguration="BasicHttpEndPoint"
                    contract="MyService.IService"
                    name="SOMENAME"/>
        </client>
      </system.serviceModel>
    

    Wednesday, January 30, 2013 11:37 PM

Answers

  • Resolved..incase you need

    i had to add <httpRuntime maxRequestLength="2147483647" />

      <system.web>
        <httpRuntime maxRequestLength="2147483647" />
      </system.web>
    Thursday, January 31, 2013 1:40 AM

All replies