Ajax problems with return data from web service

Ajax problems with return data from web service

When I am calling a web service through an ajax function, at a certain size the string that I am trying to return is never returned and the success or error function is never called. The code I am using is listed below. On the web service, if I set i in the for block to loop to i < 500 everything works fine, if I increase the number of times to loop to  i < 5000, I never get a success or error message back. I am using IE 8.0 and jquery 1.5.
 
The jquery code I am using is listed below:
 
    <script type="text/javascript">
        var AjaxResults;

        $.fn.CallAjax = function (Async, DTO, URL) {
            $.ajax({
                async: Async,
                type: "POST",
                cache: false,
                url: URL,
                data: JSON.stringify(DTO),
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    alert('Success');
                },
                failure: function (msg) {
                    alert('Error');
                }
            });
        }















        $(document).ready(function () {           
            var Async = false;
            var DTO = {};
            URL = "Services/RemisServices.asmx/TestLength";
            alert('before call');
            $(this).CallAjax(Async, DTO, URL);
            alert('after call');
        });
    </script>







 
---- Partial listing of the web service, method I am calling listed in totality , this method is working correctly.
 
    public class RemisServices : System.Web.Services.WebService
    {
        [WebMethod(EnableSession = true)]
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
        public string TestLength()
        {
            StringBuilder sb = new StringBuilder();
            String retstr;
            for (int i = 0; i < 5000; i++)
            {
                string stri = i.ToString();
                sb.AppendLine("Test Line : " + stri + " Test Value : " + stri);
            }
            retstr = sb.ToString();
            return (retstr);
        }














 
I am sure I am doing something incorrect in terms of settings in ajax, any help you could give would be greatly appreciated. One other generic type of question, Ive read that setting async to false when you need the code to be synchronized is perhaps not the best way to block the user, what is the best pattern?
 
Thank You