nmarus / node-ews

A simple JSON wrapper for the Exchange Web Services (EWS) SOAP API.
MIT License
116 stars 52 forks source link

Possible 'undefined' error of 'ExchangeServices' on ews.js 'run' function #107

Open jeffreyleeon opened 5 years ago

jeffreyleeon commented 5 years ago

I am using version 3.2.4. I have setup a valid email account and successfully authenticated. When calling ".run" function from ews.js, the returned client's ExchangeServices is undefined, causing the chaining of "client.describe().ExchangeServices.ExchangeServicePort" failing.

Did I wrongly setup the environment? Or the account needs to subscribe on some ExchangeServices before getting a valid "ExchangeServices" object? Thank you.

2019-01-15T01:15:17.584611084Z /usr/src/app/node_modules/node-ews/lib/ews.js:227
2019-01-15T01:15:17.584704844Z           let validEwsFunctions = _.keys(client.describe().ExchangeServices.ExchangeServicePort);
2019-01-15T01:15:17.584720800Z                                                                            ^
2019-01-15T01:15:17.584733194Z
2019-01-15T01:15:17.584744904Z TypeError: Cannot read property 'ExchangeServicePort' of undefined
2019-01-15T01:20:02.094181310Z     at soap.createClient (/usr/src/app/node_modules/node-ews/lib/ews.js:227:76)
2019-01-15T01:20:02.094194368Z     at /usr/src/app/node_modules/soap/lib/soap.js:59:5
2019-01-15T01:20:02.094305407Z     at WSDL.callback (/usr/src/app/node_modules/soap/lib/soap.js:26:9)
2019-01-15T01:20:02.094323245Z     at /usr/src/app/node_modules/soap/lib/wsdl.js:1073:12
2019-01-15T01:20:02.094335460Z     at /usr/src/app/node_modules/soap/lib/wsdl.js:1187:7
2019-01-15T01:20:02.094347390Z     at WSDL._processNextInclude (/usr/src/app/node_modules/soap/lib/wsdl.js:1158:12)
2019-01-15T01:20:02.094359511Z     at WSDL.callback (/usr/src/app/node_modules/soap/lib/wsdl.js:1186:10)
2019-01-15T01:20:02.094370698Z     at /usr/src/app/node_modules/soap/lib/wsdl.js:1073:12
2019-01-15T01:20:02.094381991Z     at /usr/src/app/node_modules/soap/lib/wsdl.js:1187:7
2019-01-15T01:20:02.094403831Z     at WSDL._processNextInclude (/usr/src/app/node_modules/soap/lib/wsdl.js:1158:12)
2019-01-15T01:20:02.094415685Z     at WSDL.callback (/usr/src/app/node_modules/soap/lib/wsdl.js:1186:10)
2019-01-15T01:20:02.094426768Z     at /usr/src/app/node_modules/soap/lib/wsdl.js:1073:12
2019-01-15T01:20:02.094438215Z     at WSDL._processNextInclude (/usr/src/app/node_modules/soap/lib/wsdl.js:1158:12)
2019-01-15T01:20:02.094449418Z     at WSDL.processIncludes (/usr/src/app/node_modules/soap/lib/wsdl.js:1201:8)
2019-01-15T01:20:02.094463167Z     at /usr/src/app/node_modules/soap/lib/wsdl.js:1028:10
2019-01-15T01:20:02.094474491Z     at process._tickCallback (internal/process/next_tick.js:176:11)
jeffreyleeon commented 5 years ago

I am using the config "temp" to always clone messages.xsd, services.wsdl and types.xsd to '/tmp' folder.

var ewsConfig = {
      username: username,
      password: password,
      host: url,
      temp: '/tmp'
};

And I noticed that from time to time services.wsdl file will be regenerated, causing "ExchangeServices" to be undefined.

SDETQATestAutomation commented 4 years ago

I am also getting similar issue from few days.

TypeError: Cannot read property 'ExchangeServicePort' of undefined Any workaround to fix this issue?

apitts commented 3 years ago

We are also experiencing this issue while using the temp folder config setting.