exchange server - EWS API - Error when recreating notification subscriptions -


when working pull subscriptions office365 calendar folders, i've been getting lot of errorreadeventsfailed messages in sendnotification request. error means subscription can no longer found, , server should no longer expect new notifications.

checking microsoft's recommended error handling, solution use autodiscover rediscover externalewsurl or ewspartnerurl, , create new subscription.

with office365, autodiscovery service seems near impossible combination of oauth2 service accounts i've been using https://outlook.office365.com/ews/exchange.asmx main ews endpoint.

however, when try create new subscription specific calendar folder, keep getting generic 500 errornorespondingcasindestinationsite error:

exchange web services not available request because none of client access servers in destination site process request.

the strange part this happens directly after receiving initial errorreadeventsfailed error. if try again in, say, 30 seconds, request goes through without problem.

after doing research, seemed users found helpful ensure x-anchormailbox header set user service account wishes impersonate. double-checked header, , indeed being sent along request resubscribe.

this problem may solvable exponential back-off solution, or retrying x amount of times until request goes through. seems me when subscription gets "lost", o365 service needs time change dns of exchange server (it's thing can think of).

any appreciated!


Comments