TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ciaran O Neill
NA
1
0
Maximum number of items that can be serialized or deserialized in an object graph is '65536'
Oct 7 2008 12:10 PM
Hi,
I'm trying to debug a problem that's occurring when sending large amounts of data over WCF. The error message from the System.ServiceModel.CommunicationException that's being thrown is:
"There was an error while trying to serialize parameter http://tempuri.org/:batch. The InnerException message was '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. '. Please see InnerException for more details."
I've tried changing everything I could find in both the service web.config and the client app.config, but nothing is working for me. My relevant sections from web.config are:
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_ISyncEndpoint" maxBufferPoolSize="10485760" maxReceivedMessageSize="2147483647">
<readerQuotas maxStringContentLength="8192" maxArrayLength="20971520" />
<reliableSession enabled="true" ordered="true" />
<security mode="None">
<transport clientCredentialType="None" />
<message establishSecurityContext="false" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="SyncWebService.SyncEndpoint" behaviorConfiguration="WSHttpBinding_ISyncEndpoint_Behaviour">
<host>
<baseAddresses>
<add baseAddress="http://localhost:3923/SyncEndpoint.svc"/>
</baseAddresses>
</host>
<endpoint binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISyncEndpoint" contract="SyncWebService.ISyncEndpoint" />
</service>
</services>
<behaviors>
<!--<endpointBehaviors>
<behavior name="WSHttpBinding_ISyncEndpoint_Behaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/> 2147483647
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</endpointBehaviors>-->
<serviceBehaviors>
<behavior name="WSHttpBinding_ISyncEndpoint_Behaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
The sections from the app.config are:
<system.serviceModel>
<bindings>
<!-- Http binding settings -->
<wsHttpBinding>
<binding name="WSHttpBinding_ISyncEndpoint" closeTimeout="05:01:00" openTimeout="05:01:00" receiveTimeout="05:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<!--<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />-->
<readerQuotas maxStringContentLength="8192" maxArrayLength="20971520" />
<reliableSession ordered="true" inactivityTimeout="05:50:00" enabled="true" />
<security mode="None">
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<!-- communication channel to the SyncWebService remote web service (refered to as SyncEndpoint.svc) -->
<!--<endpoint address="http://localhost:3923/SyncEndpoint.svc" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_ISyncEndpoint" contract="SyncWebService.ISyncEndpoint" name="WSHttpBinding_ISyncEndpoint" />-->
<endpoint address="http://localhost:3923/SyncEndpoint.svc" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_ISyncEndpoint" contract="SyncWebService.ISyncEndpoint" name="WSHttpBinding_ISyncEndpoint"
behaviorConfiguration="WSHttpBinding_ISyncEndpoint_Behaviour" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="WSHttpBinding_ISyncEndpoint_Behaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/> <!--2147483647-->
</behavior>
</endpointBehaviors>
<!--<serviceBehaviors>
<behavior name="WSHttpBinding_ISyncEndpoint_Behaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</serviceBehaviors>-->
</behaviors>
</system.serviceModel>
This is causing me a big problem, so if anyone has an idea it would be much appreciated.
TIA,
Ciaran O'Neill
Reply
Answers (
3
)
WCF: The maximum string content length quota (8192) has been exceeded
Problem in using an existing service