I am having a similar problem (or maybe the same problem), but I changed the maxJsonLength in my web.config (copy below), and this did not help (details of my problem below). Ideas?
<jsonSerialization maxJsonLength="50000">
I am calling a web service from javascript and it returns a collection of objects. Everything works fine until the web service returns a larger number of objects (601). Via the debugger, the web service is working fine, and everything works okay when the number of objects is small. Ideas??
My javascript call to web service: ILIMSWrapper.GetMaterials(queryField, queryValue, onILIMSsucceeded, onILIMSfailed);
Results in calling the onILIMSfailed function, with error containing the following information:
_exceptionType: System.InvalidOperationException
_message: Maximum length exceeded.
_stackTrace: at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams) at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)