Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF rest large json error

Tags:

json

wcf

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?

like image 268
Jabolcna Pita Avatar asked Feb 25 '26 11:02

Jabolcna Pita


1 Answers

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

<dataContractSerializer ignoreExtensionDataObject="true" maxItemsInObjectGraph="123456" />
like image 155
RoelF Avatar answered Feb 27 '26 03:02

RoelF



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!