Feb 02, 2012, 2:55 AM
[CLOSED] Ext.Ajax.request: Failure due to javascript asynchronous nature problem
Hi,
I am currently using Ext.Ajax.request to call a webservice which is occasionally slow due to many factors (database, network, etc).
And in some cases, the Ajax request goes to FAILURE with no RESPONSE value while the webservice is still running, which causes "jsonValue.Message" to be null and javascript to show NULL error.
(I recreated the scenario by adding breakpoints and slowing the webservice manually).
Can you advice if its possible to make this request synchronous, or if the FAILURE trigger can be delayed further, or if there is steps I neglected to add to make RESPONSE value not NULL when the asynchronous problem happen?
Thanks, J
I am currently using Ext.Ajax.request to call a webservice which is occasionally slow due to many factors (database, network, etc).
And in some cases, the Ajax request goes to FAILURE with no RESPONSE value while the webservice is still running, which causes "jsonValue.Message" to be null and javascript to show NULL error.
(I recreated the scenario by adding breakpoints and slowing the webservice manually).
Can you advice if its possible to make this request synchronous, or if the FAILURE trigger can be delayed further, or if there is steps I neglected to add to make RESPONSE value not NULL when the asynchronous problem happen?
Thanks, J
Ext.Ajax.request({
method: 'post',
url: "../WebifyService.asmx/MethodThatIsSlow";,
headers: { 'Content-Type': 'application/json;charset=utf-8' },
jsonData: { 'param': parameters },
success: function(response) {
//Success code goes here
},
failure: function(response, options) {
var jsonValue = Ext.util.JSON.decode(response.responseText);
alert(jsonValue.Message);
}
});
Last edited by Daniil; Feb 02, 2012 at 8:35 AM.
Reason: [CLOSED]