Open anujkumar-df opened 7 years ago
You can modify servicerequestbase.ts to create a hook there. Or better create a callback in ewsservicexmlreader.ts where the xml is transformed.
If you can give some pseudo code, that would be great. I mean where you put callback, etc.
if you are not in hurry, I can add this as feature request.
Well tbh, I have a deadline to meet :), so if you can provide me a pseudo code, it would be great and I can perhaps create a PR in lets say few days.
take a look at XHRDefaults.ts files. you can add a static/instance field registering callbbacks like this
class XHRDefaults{
static EWSCallBacks:Fucntion[] = [];
//------ other code
// - -- in function XHR: before line ---- resolve(setupXhrResponse(xhrResponse));
if(XHRDefaults.EWSCallBacks && EWSCallBacks.length >0){
//other validations
XHRDefaults.EWSCallBacks.foreach(cb=>{
cb(xhrResponse.response)
});
}
}
register callback when you import ews - before creating any instance of service.
var ews = require("ews-javascript-api");
ews.XHRDefaults.EWSCallBacks.push(function(raw){console.log(raw)});
does this help?
that would still be non optimal solution, EWS has some mechanism of writing tracing adapters which you can track in #80
when you use instance field, you have to get the XHRApi
property from ExchangeService instance.
var ews = require("ews-javascript-api")
var svc = new ews.ExchangeService(params);
svc.XHRApi.EWSCallBacks.push(fucntion_Call);
Hi Gautam,
Is there any way to access raw response sent by exchange ?