Sometime when working with ScriptSevice and ScriptMethod in ASP.net webservice following error may occur.
Solution for this is to put following configuration in web.config file.
In above configuration instead you can set maxJsonLength to certain value so it allow larger string.
Maximum value for that field is 2147483647 as this property is System.Int32.
More information you can find it on following location.