
if (typeof XMLHttpRequest == 'undefined') {
XMLHttpRequest = function() {
var msxmls = ['MSXML4', 'MSXML3', 'MSXML2', 'Microsoft'];
for (var i=0; i < msxmls.length; i++) {
try {
return new ActiveXObject(msxmls[i]+'.XMLHTTP');
} catch (exception) {
var avertissement = new ExceptionAEF('WC004');
avertissement.afficher();    
}
window.status = "";
}
throw new ExceptionAEF('WC001');
}
}
function S_setUrl(p_url) {
this.url = p_url;
}
function S_getUrl() {
return this.url;
}
function S_handlerEvenement(self) {
window.status = 'Methode a redéfinir';
if (self.xmlhttp.readyState == 4) {
reponse = self.xmlhttp.responseText;
alert(reponse);
}
}
function S_finaliserExecution() {
try {
this.xmlhttp.send(null);
} catch(e) {
var avertissement = new ExceptionAEF("WC002");
avertissement.afficher();
}
}
function S_executer() {
this.xmlhttp.open("GET", this.url, true);
var self = this;
this.xmlhttp.onreadystatechange = function() {
self.resultat = self.handlerEvenement(self);
};
this.finaliserExecution();
}
function ClientService() {
try {
this.xmlhttp = new XMLHttpRequest();
} catch(exception) {
var avertissement = exception;
if (!(exception instanceof ExceptionAEF)) {
avertissement = new ExceptionAEF('WC005');
}
avertissement.afficher();
}
this.url = '';
this.resultat = null;
this.setUrl = S_setUrl;
this.getUrl = S_getUrl;
this.executer = S_executer;
this.handlerEvenement = S_handlerEvenement;
this.finaliserExecution = S_finaliserExecution;
}
