nmarus / node-ews

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

Issue with Example 5: Creating a Push Notification Service Listener #85

Closed vksinghibm closed 6 years ago

vksinghibm commented 6 years ago

When I run, it seems there is an issue with this code

===== .then(server => { server.log = function(type, data) { console.log(new Date().toISOString(), '| ', type, ':', data); }; });

Any pointer please.

vksinghibm commented 6 years ago

Once I include this as part of notification service , it starts working. Please update the code

// create the listener service ews.notificationService(serviceOptions, function(response) { console.log(new Date().toISOString(), '| Received EWS Push Notification'); console.log(new Date().toISOString(), '| Response:', JSON.stringify(response)); // Do something with response return {SendNotificationResult: { SubscriptionStatus: 'OK' } }; // respond with 'OK' to keep subscription alive // return {SendNotificationResult: { SubscriptionStatus: 'UNSUBSCRIBE' } }; // respond with 'UNSUBSCRIBE' to unsubscribe }).then(server => { server.log = function(type, data) { console.log(new Date().toISOString(), '| ', type, ':', data); }; });

christiannguyen commented 6 years ago

@vksinghibm did you actually get this working correctly? if so, can i see some sample code and responses? thanks