problem to call WCF service multiple times
Hi Guys,
I need to get data thru WCF service, and it should happens in a cycle.
Without cycle all good..
In the cycle, method ServiceSucceeded(msg, index);
get executted twice which is perfect, BUT index always = 2
for
(index = 0; index < 2; index++) {
$.ajax({ type:
"POST"
, url: webMethod,
data: JSON.stringify(parameter),
contentType:
"application/json; charset=utf-8"
, dataType:
"json"
, ProcessData:
true
, success:
function
(msg) {
//On Successfull service call
ServiceSucceeded(msg, index);
},
error: ServiceFailed
// When Service call fails
});
HOW to pass 0, them 1 in this WCF call ??