none
413 Error in WCF Data Services - Request Entity Too Large RRS feed

  • Question

  • I am getting this error when I am trying to send a string of length 68000 characters to the service to insert into the DB.

    But on the context.savechanges() line, it is giving this error.

    As per the googled articles, I have increased the maxReceivedFilesize parameter & below is the service web.config:

    <?xml version="1.0"?>

    <configuration>

      <connectionStrings>

        <add name="CRFR_DB_Entities" connectionString="metadata=res://*/ModelCRFREntities.csdl|res://*/ModelCRFREntities.ssdl|res://*/ModelCRFREntities.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=CANATHOSTDEVDB2\SQL3;initial catalog=CRFR_DB_DEV;integrated

    security=True;MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

      </connectionStrings>

      <appSettings>

        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />

      </appSettings>

      <system.web>

        <compilation debug="true" targetFramework="4.5" />

        <httpRuntime targetFramework="4.5" maxRequestLength="2147483647" executionTimeout="360000"/>

      </system.web>

      <system.serviceModel>

    <services>

          <service name="Deloitte.CA.CRFR.DataRepositoryService.CRFRDataService" >

      <endpoint binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IEmailService" contract="System.Data.Services.IRequestHandler" address="REST"></endpoint>

          </service>

        </services>

        <bindings>

          <basicHttpBinding>

          <binding name="BasicHttpBinding_IEmailService" messageEncoding="Mtom" transferMode="Streamed" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">

    <readerQuotas maxDepth="128" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />

            </binding>

          </basicHttpBinding>

        </bindings>

        <behaviors>

          <serviceBehaviors>

            <behavior>

              <!-- To avoid disclosing metadata information, set the values below to false before deployment -->

              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="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"/>

            </behavior>

          </serviceBehaviors>

        </behaviors>

        <protocolMapping>

            <add binding="basicHttpsBinding" scheme="https" />

        </protocolMapping>   

        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />

      </system.serviceModel>

      <system.webServer>

        <modules runAllManagedModulesForAllRequests="true"/>

        <!--

            To browse web app root directory during debugging, set the value below to true.

            Set to false before deployment to avoid disclosing web app folder information.

          -->

        <directoryBrowse enabled="true"/>

      </system.webServer>

    </configuration>

    Please let me know if I am missing anything, as I am still getting this error.

    Wednesday, July 17, 2013 3:09 AM

All replies