I found myself working on a Silverlight application I built last year when the end users reported that they were getting errors when loading certain data sets.
While researching the issue, I discovered that only one of the datasets was having an issue, and it was the dataset with the most records, and that the records had grown significanly over the past few months.
The error you ask?
"Load operation failed for query 'Get_RawDataByRegion'. The remote server returned an error: NotFound."
Well, how could it be NotFound? It works for every other region, but not this one, and it worked just fine last month.
After a bunch of digging, and some well placed breakpoints, I discovered that the data was indeed returning to the Domain Data Source in my Silverlight project, but when it was being recieved by my application, there was a problem.
It turns out to be a 'size' issue.
By default, RAI imposes a 'maxItemsInObjectGraph' limit of '65532'.
This limit is in place for a reason... without it, we might not stop and think about our web service and how much data we are sending over the wire.
Now, it would be nice if the default 'maxItemsInObjectGraph' was coded in the web.config for us, so we had a logical place to check for this type of issue, but alas, we have to wire it up ourselves.
In the web.config, in order to change the 'maxItemsInObjectGraph'...wire up the following...
<system.serviceModel>
...
<services>
<service name="MyNameSpace.MyDomainService"
behaviorConfiguration="MyDomainService_Behavior">
</service>
</services>
...
<behaviors>
<serviceBehaviors>
<behavior name="MyDomainService_Behavior">
<dataContractSerializer maxItemsInObjectGraph="131072" />
<!--change this number to greater than 65536 (131072 is double the default value)-->
</behavior>
</serviceBehaviors>
</behaviors>
...
</system.serviceModel>
Regards,
MT