I'd been running an ExtJS app that throws params to a .NET WCF server and expected JSON returned.  It worked from within the application, but every time I tried with a much more generic request from a test app, it borked with a "communication failure" error.  If I sent back null as a return object, it serialized and was processed perfectly.  Strange.

I haven't chased this down definitively, but after limiting my results fairly severely (first from an unencumberedly huge number of returns, then to 800, then finally to 80), things started working again.

I think I hit a memory ceiling somewhere before this, but it's still good to know that there is a max size on IIS for AJAX returns.  From "How to configure maxJsonLength in ASP.NET AJAX applications":
Invoking web methods from client scripts is fun. But before you roll out your cool applications into the production, please don't forget to reconfigure the max JSON string length, represented by either the maxJsonLength value in the web configuration file or the MaxJsonLength property of the JavaScriptSerializer class.

Labels: , ,