Click here to Skip to main content
15,922,015 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am pretty new to Restful WCF services so bear with me. I am trying to build a simple RESTful WCF service that returns a List of Students as json response.

In Response Approx 3842 Records are Showing when i invoke the same method in Browser but in actual List contains approx 9000 records.

Why response is truncated?

1 solution

hi one of two things....

Try setting maxJsonLength property on your web.config:

               <jsonserialization maxjsonlength="Large number here" />

or because it is WCF you may want to look at the service behaviours. Try setting the maxitemsinobjectgraph property.

            <behavior name="metadataBehavior">
                <servicemetadata httpgetenabled="true" httpgeturl="" />
                <servicedebug includeexceptiondetailinfaults="false" />
                <datacontractserializer maxitemsinobjectgraph="2147483646" />

you may find other examples from here :[^]
Share this answer
Bhupendra Chauhan 19-Aug-14 7:28am    
Thanks. It works.
db7uk 19-Aug-14 7:42am    

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900