Might have found a tiny bug in the ZmCsfeAsynchCommand class.

Method: ZmCsfeAsynchCommand.prototype.rpcCallback, starting at ligne 106

I simply had to add the following 2 lines in order to make the function correctly behave:
this._fireInvokeEvent(newEx); // at line 161
return;

After some debugging, I noticed I was getting an Exception in that block but it was then not passed to the listener. I noticed that the Exception was thrown but that it was actually overriden in the following block by another exception, since you use a single variable newEx in your code:

try {
//check if we received a Fault message from server
var fault = AjxSoapDoc.element2FaultObj(this._responseSoapDoc. getBody());
if (fault) {
newEx = new ZmCsfeException("Csfe service error", fault.errorCode, "ZmCsfeAsynchCommand.prototype.rpcCallback", fault.reason);
}
} catch (ex) {
newEx = ex;
}


In other words, if you get 2 Exceptions, the first one will never get to the application level. FYI, I was getting an Exception because the server was not sending back XML, but the content-type of the response was set to XML. So, if you check the above block, if there was an error parsing the response, variable this._responseSoapDoc will not be defined, and that is were the second exception was occuring.

Anyway, why not stop the execution of this method at the first exception ?

Heladito