Jabolcna Pita
Jabolcna Pita

Reputation: 73

WCF rest large json error

I have a WCF rest service using webHttpBinding that returns JSON result. The problem is that I can't return large JSON results. Works great for smaller results, but at about 1.16MB result size, I get empty responce. Fiddler gives me this:

HTTP/1.1 504 Fiddler - Receive Failure
Content-Type: text/html; charset=UTF-8
Connection: close
Timestamp: 15:57:24.251

[Fiddler] ReadResponse() failed: The server did not return a response for this request.

Chrome gives me 'Error 101 (net::ERR_CONNECTION_RESET): The connection was reset.'

I tried to set every option in binding and readerQuotas section of web.config that starts with 'max' but it did not work. I host the WCF service in IIS but the same thing happens in self-hosted service.

How do I increase max sent JSON result?

Upvotes: 3

Views: 3359

Answers (1)

RoelF
RoelF

Reputation: 7573

in your service behavior, try playing around with the maxItemsInObjectGraph:

<dataContractSerializer ignoreExtensionDataObject="true" maxItemsInObjectGraph="123456" />

Upvotes: 7

Related Questions