Getting loads of data from a WCF

I was pumping data from my WCF service in my Silverlight chart, and when loading a year of data with a record for every 15 minutes:

Maximum number of items that can be serialized or deserialized in an object graph is ‘65536’

Ok, i was loading 35000 objects with 20 properties, but i didn’t want to be limitated.

The solution: add this code

<dataContractSerializer maxItemsInObjectGraph="10000000"/> 

 
to the bahaviour:

<behavior name="frsp.Web.FinanceDataBehavior">
     <serviceMetadata httpGetEnabled="true" />
     <serviceDebug includeExceptionDetailInFaults="false" />
     <dataContractSerializer maxItemsInObjectGraph="10000000"/>
</behavior><dataContractSerializer maxItemsInObjectGraph="10000000"/>

One thought on “Getting loads of data from a WCF

  1. I’ve had similar problems when loading large amounts of data in terms of binary size. Because that size is also set to 65536, by heart I can’t remember if it were bytes or kbytes.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s