gpt4 book ai didi

wcf - 对象图中可以序列化或反序列化的最大项目数...

转载 作者:行者123 更新时间:2023-12-04 14:17:19 27 4
gpt4 key购买 nike

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

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

使用上面的 xml 配置块,我们过去没有问题地避免了这个问题,但现在它不起作用了。唯一的区别是我们在这里使用 已知类型 在我们试图在 WCF 方法中反序列化的巨大列表元素中。

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

最佳答案

不要忘记检查客户端配置。

查看 How to fix MaxItemsInObjectGraph error? 中的类似答案

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



maxItemsInObjectGraph ignored

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



.

关于wcf - 对象图中可以序列化或反序列化的最大项目数...,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9191167/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com