3

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?

1 Answer 1

7

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

<dataContractSerializer ignoreExtensionDataObject="true" maxItemsInObjectGraph="123456" />
Sign up to request clarification or add additional context in comments.

4 Comments

It worked! Thank you and sorry for late reply, I only had time to test it now.
That's good, I'm happy it worked. Could you set the answer to accepted then? Thanks!
Thank you, thank you, thank you I have been struggling with this for an long time and it has caused me a lot of pain. Out of interest why have you set the maxItemsInObjectGraph to "123456" it works but I want to know why it works.
You can set it to the max size of Int32.MaxValue. The maximum number of items to serialize or deserialize. msdn.microsoft.com/en-us/library/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.