【问题标题】:SharePoint 2010 WCF Service MaxItemsInObjectGraph problemSharePoint 2010 WCF 服务 MaxItemsInObjectGraph 问题
【发布时间】:2011-07-27 00:00:25
【问题描述】:
我在将自定义 WCF 服务部署到 SharePoint 2010 时遇到问题。尝试将某些数据导入客户端时收到以下错误:
'Maximum number of items that can be serialized or deserialized in an object graph is '65536'. Change the object graph or increase the MaxItemsInObjectGraph quota. '.
我尝试使用http://shaunedonohue.blogspot.com/2011/03/reader-quotas-for-wcf-services-in_4706.html 中概述的机制进行一些更改,但我仍然收到此错误 - 这些配额设置似乎与 MaxItemsInObjectGraph 设置无关。在服务的 ServiceBehaviour 属性中更改此设置似乎也不起作用。
以前有人遇到过这个问题吗?
【问题讨论】:
标签:
c#
wcf
binding
sharepoint-2010
readerquotas
【解决方案1】:
除了来自 Shaune 博客的信息外,我还可以按照 How to fix MaxItemsInObjectGraph error? 中概述的步骤解决此问题。也就是说:
-
WCF ServiceBehavior 属性要求 MaxItemsInObjectGraph 设置如下:
[ServiceBehavior(Namespace = "http://www.mydomain.net/MyApp/SharePoint", Name = "MySharePoint2010Service", MaxItemsInObjectGraph = 65536000)]
在创建通道之前,需要更新客户端以更改上述问题中所述的序列化行为。
我无法找到以前遇到过此 SharePoint 2010 问题的其他人,但希望这对将来的人有所帮助。 SharePoint 的动态配置不够全面,无法涵盖所有 WCF 设置,但它仍然比手动更新整个场中的 web.config 文件更受欢迎。