可以在对象图中序列化或反序列化的最大项目数...具有知识类型 [英] Maximum number of items that can be serialized or deserialized in an object graph... with knowtypes

查看:160
本文介绍了可以在对象图中序列化或反序列化的最大项目数...具有知识类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WCF 4.0服务中,我们在通用列表中收到大量数据。该列表对象图大于65536的默认限制。我们已经习惯了,因此我们已经配置了该服务以获取那些大图。

In a WCF 4.0 service we receive a huge amount of data in a generic list. This list object graph is bigger than the 65536 default limit. We are quite used to it, so we have configured the service for being able to getting those big graphs.

<serviceBehaviors>
    <behavior>
      <dataContractSerializer maxItemsInObjectGraph="2147483647" />
    </behavior>
  </serviceBehaviors>

使用上面的xml配置块,我们过去可以毫无问题地避免了这个问题,但是现在它不起作用。唯一的不同是,这里我们在试图使用WCF方法反序列化的庞大列表元素中使用 KnownTypes

With the above chunk of xml config we have avoided the problem in the past with no problem, but now it doesn't work. The only difference is that here we are using KnownTypes in the huge list elements that we are trying to deserialize in the WCF method.

也许我是否缺少某些已知类型的特殊配置?

Maybe, am I missing some special configuration for knowntypes?

推荐答案

别忘了检查客户端配置。

Don't forget to check client configuration.

请参见如何解决MaxItemsInObjectGraph错误?


您需要使用以下行为在
dataContractSerializer上设置MaxItemsInObjectGraph:客户端和
服务。

You need to set the MaxItemsInObjectGraph on the dataContractSerializer using a behavior on both the client and service.

maxItemsInObjectGraph被忽略


我忘了将此设置放在客户端应用程序中。配置文件

I had forgot to place this setting in my client app.config file

这篇关于可以在对象图中序列化或反序列化的最大项目数...具有知识类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆