linnkb
linnkb

Reputation: 525

Limitations retrieving JSON String from web service using MonoTouch

I am developing an iOS Application using MonoTouch. The application collects its data from a web service, using this code:

private static string getResult (string url)
        {
            string result;
            var request = HttpWebRequest.Create (url);
            request.ContentType = "application/json";
            request.Method = "POST";


            using (HttpWebResponse response = request.GetResponse() as HttpWebResponse)
            {
                if (response.StatusCode != HttpStatusCode.OK)
                    Console.Out.WriteLine("Error fetching data. Server returned status code: {0}", response.StatusCode);
                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                {
                    result = reader.ReadToEnd();
                }
            }

            return result;
        }

And this works fine, BUT when the json string returned from the Web Service reaches a certain size, the request returns with Internal server error 500. I have tried to invoke the service method directly in a web browser, and this returns a json string as expected. Why will it not work with my code, and is there a way to fix this?

Update: I think this might solve my problem: http://forums.iis.net/t/1176077.aspx/1

Upvotes: 0

Views: 144

Answers (1)

Asif
Asif

Reputation: 21

Try Increasing Time Out for your service request. Your service must be timing out resulting 500 error

Also check this http://www.checkupdown.com/status/E500.html

Upvotes: 1

Related Questions