Currently implementing a web method (mvc framework 4.5.2) which is supposed to received a list of items as a parameter input as bellow:
[HttpPost]
public ActionResult GetDummyResults(DummyProductsDto productsDto)}
{
var dummy = getMeSomeResults(productsDto);
return Json(new { result = dummy }, JsonRequestBehavior.AllowGet);
}
When my list of products is less than 2K, the method works just fine, if it goes over 2K items, it crashes with the exception: Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property. Parameter name: input
I've tried a plethora of suggested tweaks for the web.config like ( <jsonSerialization maxJsonLength="2147483647"/>
) to no avail. Some others point to implement this inside the method: var serializer = new JavaScriptSerializer(); serializer.MaxJsonLength = Int32.MaxValue;
but I guess this suggestion applies to issues with the response, not the request itself which seems to be the issue here. Any hint as to where should I be aiming at ? ... it seems to me, the request size of the input parameter to to be the culprit here, just not sure how to fix it.
-thanks,