【问题标题】:RIA Services: Is there a limit to the JSON deserialization?RIA 服务:JSON 反序列化有限制吗?
【发布时间】:2009-07-31 01:26:42
【问题描述】:

我在我的一个 silverlight 应用程序中使用 RIA 服务。我可以从我的服务中成功返回大约 500 个实体(或大约 500 kb JSON),但在客户端失败的任何东西 - 浏览器崩溃(IE 和 Firefox)。

我可以点击以下链接并成功获取 JSON:
http://localhost:52878/ClientBin/DataService.axd/AgingReportPortal2-Web-Services-AgingDataService/GetAgingReportItems

...所以我想知道这笔交易是什么。

反序列化的数量是否有限制?如果是这样,有没有办法增加它?我记得在为此使用 WCF 时遇到了类似的问题 - 我需要将 web.config 中的 maxItemsInObjectGraph 设置为更高的数字 - 也许我需要做类似的事情?

这是我用来获取实体的代码:

    // 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;
    }

任何帮助将不胜感激 - 我已经花了几个小时试图解决这个问题,但没有发现任何人有同样的问题。

谢谢,
查尔斯

【问题讨论】:

    标签: silverlight-3.0 wcf-ria-services


    【解决方案1】:

    也可以尝试添加/增加它,默认为 8192

    <readerQuotas maxArrayLength="5000000" /> 
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-03
      • 1970-01-01
      • 1970-01-01
      • 2019-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多