locked
MaxItemsInObjectGraph RRS feed

  • Question

  •  


    I get the below error
    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.

    even though i have set the MaxItemsInObjectGraph on the client and server using the following code
    Can any one make any suggestions?

    foreach
    (OperationDescription op in _hostServices.Description.Endpoints[0].Contract.Operations) {
    op.Behaviors.Find<
    DataContractSerializerOperationBehavior>().MaxItemsInObjectGraph = 2147483647; }ServiceBehaviorAttribute)_hostServices.Description.Behaviors[0]).MaxItemsInObjectGraph = 2147483647;
    return _hostServices;

    ((

    Friday, August 28, 2009 9:41 AM

Answers

  • Hi,

    Here is a former thread discussing on the same issue:

    #MaxItemsInObjectGraph
    http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/c85f3ed2-0b55-4375-af79-5926b6cc527c

    Please try setting the value in configuration file(via serviceBehavior) and also enlarge those quota in binding(ReaderQuota):

    <readerQuotas maxDepth="900000"
                           
    maxStringContentLength="900000"
                           
    maxArrayLength="900000" 
                           
    maxBytesPerRead="900000"
                         
     maxNameTableCharCount="900000" />


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, September 2, 2009 10:37 AM

All replies

  • anyone have any ideas?
    Sunday, August 30, 2009 1:51 AM
  • Hi,

    Here is a former thread discussing on the same issue:

    #MaxItemsInObjectGraph
    http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/c85f3ed2-0b55-4375-af79-5926b6cc527c

    Please try setting the value in configuration file(via serviceBehavior) and also enlarge those quota in binding(ReaderQuota):

    <readerQuotas maxDepth="900000"
                           
    maxStringContentLength="900000"
                           
    maxArrayLength="900000" 
                           
    maxBytesPerRead="900000"
                         
     maxNameTableCharCount="900000" />


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Wednesday, September 2, 2009 10:37 AM