I've been working on an Android mobile application which is a cross platform browser based application developed using HTML5, javascript, jQuery and PhoenGap.
Application being a client-server based, we make frequent asynchronous web service calls to fetch data from the server. In this scenario, we are facing problem while fetching data which involves huge amount of data. Here, in this case there are so many database queries that will run at the background to get the data.
We are testing the application using a 2G connection which is resulting in a status 0 error message after few mins.
My question here is, will there be an option for the mobile browser to abort a web service call after few mins before receiving the response?
We are making an ajax call to fetch the data. Sample code for your reference. We have tested with various timeout options but there is no positive result. The same is working fine on a 3G network.
$.ajax({
type: "POST",
url: wsUrl,
contentType: "text/xml",
dataType: "xml",
data: soapRequest,
async: true,
timeout:300000,
tryCount:0,
retryLimit:3,
success: processSuccess,
error: processError
});