views:

285

answers:

1

I'm using RIA Services in one of my silverlight applications. I can return about 500 entites (or about 500 kb JSON) from my service successfully, but anything much over that fails on the client side - the browser crashes (both IE and Firefox).

I can hit the following link and get the JSON successfully:
http://localhost:52878/ClientBin/DataService.axd/AgingReportPortal2-Web-Services-AgingDataService/GetAgingReportItems

... so I wonder what the deal is.

Is there a limit to how much can be deserialized? If so, is there a way to increase it? I remember having a similar problem while I was using WCF for this - I needed to set maxItemsInObjectGraph in the web.config to a higher number - perhaps I need to do something similar?

This is the code I'm using to fetch the entities:

    // Executes when the user navigates to this page.
    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        AgingDataContext context = new AgingDataContext();

        var query = context.GetAgingReportItemsQuery();

        var loadOperation = context.Load(query);
        loadOperation.Completed += new EventHandler(loadOperation_Completed);

    }

    void loadOperation_Completed(object sender, EventArgs e)
    {
        // I placed a break point here - it was never hit
        var operation = (LoadOperation<AgingReportItem>)sender;
        reportDatagrid.ItemsSource = operation.Entities;
    }

Any help would be appreciated - I've spent hours trying to figure this out, and haven't found anyone with the same problem.

Thanks,
Charles

A: 

Maybe try adding/increasing this as well, the default is 8192

<readerQuotas maxArrayLength="5000000" />
Paully

related questions