tags:

views:

33

answers:

2

I have a WCF web service defined as follows

[OperationContract]
[WebInvoke(
    Method = "GET",
    ResponseFormat = WebMessageFormat.Json,
    BodyStyle = WebMessageBodyStyle.Bare,
    UriTemplate = "Assets/{assetId}/Reports/{startDate}/{endDate}")]
JQGridDataStore<Report> GetReportsForAssetFilterByDate(string assetId, string startDate, string endDate);

I have no trouble getting responses when my JQGridDataStore contains thousands of Report instances. However, the data store exceeds 10,000 reports, I get the following in my browser:

Error 324 (net::ERR_EMPTY_RESPONSE): Unknown error.

I step through the implementation of the service, and I can see it steps through without any exceptions. The JQGridDataStore object is fully created and populated with my 10,000 + Report instances. However, when I 'F10' past the return, the browser shows an empty response. This all happens in under a second, so I don't think I'm hitting any kind of timeout.

Based on this I'm thinking there is some type of buffer size limit I'm running into. What sorts of limitations are there, and how would I tweak them?

A: 

In your client web.config, you can set the max size that your service can receive by setting the maxReceivedMessageSize attribute on your binding:

<bindings>
  <webHttpBinding>
    <binding name="myWebHttpBinding" maxReceivedMessageSize="2000000" maxBufferSize="2000000">
    </binding>
  </webHttpBinding>
</bindings>

I believe this defaults to 65536, so if your response is larger than that, that could be your trouble.

Hope this helps!!

David Hoerster
That's a WCF client setting- his client is a browser.
nitzmahone
+1  A: 

You're probably running into DataContractJsonSerializer's MaxItemsInObjectGraph quota (each individual object- if you have a couple of complex types in your array, 10k of them would easily hit this limit). You can set it in a behavior configuration like this.

That said, I'd suggest you look into a paging metaphor. Nobody wants to wait for all that stuff to come down in one shot. :)

nitzmahone
Agreed, 10,000+ reports in one go is pretty useless to our client, so I'm working on paging as well.
JadeMason