Search code examples
silverlightiis-7entity-framework-4wcf-ria-services

Load operation failed for query due to data limit


We have a silverlight application which interfaces with an RIA service to get a list of contacts to display in a grid, this normally works however we are getting the following error:

load operation failed for query x. the remote server returned an error: notfound

Tracing this through we have determined it is due to the amount of data that is being passed as it will work if the we pass roughly 3,800 records or less. We need to load at least 15,000 records from the database.

I have searched all over the internet to find a solution and have changed the following settings but nothing seems to have worked.

Settings changed are:

  • In IIS7 changed the ASP setting 'Response Buffering Limit' to 67108864
  • In IIS7 changed the ASP setting 'Maximum Requesting Entity Body Limit' to 2000000
  • In IIS7 changed the ASP setting 'Client Connection Test Interval' to 00:00:10
  • In our application web.config changed 'maxItemsInObjectGraph' to 2147483647
  • In our application web.config binding attributes 'maxReceivedMessageSize', 'maxBufferSize' and 'maxBufferPoolSize' are all set to 200000000
  • In our application web.config readerQuotas attributes 'maxArrayLength', 'maxStringContentLength', 'maxBytesPerRead', 'maxNameTableCharCount' are all set to 200000000

This is setup on Server 2008 R2 with IIS7 and using .Net 4.

This error also occurs when running in the debugger using the ASP.NET Development Server.

Any help would be appreciated.


Solution

  • Maybe your number of items is too limited in your Web.config, you can also enable detail in your faults like this to get more detail if this isn't the fix.

    <services>
      <service name="Service.Class.Full.Name"
               behaviorConfiguration="Service_Behaviour_Name" />
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="Service_Behaviour_Name">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <dataContractSerializer maxItemsInObjectGraph="65536" />
        </behavior>
     </behaviors>
    

    Service.Class.Full.Name needs to be you fully qualified service class name. Service_Behaviour_Name can be anything, but the default looks like the full service class name with - rather than .