Here's the relevant snippet from the web service:
Dictionary<string, object> jsonValuePairs = new Dictionary<string, object>();
//add some data to the dictionary...
The only way to set the maximum length for web methods that are called from client script is through the web.config file (below). What is your issue with setting this? I would do this every time over multiple xhr calls to stream parts of the data.
<system.web.extensions> <scripting> <webServices> <jsonSerialization maxJsonLength="500000"> </jsonSerialization> </webServices> </scripting> </system.web.extensions>
UPDATE: The default size is 2097152 which is equivalent to 4 MB of Unicode string data. Are you really going to send that much data back to the client? If so ouch and you prob need to look at the app design as the user experience will be slow and cumbersome.