EWS API - error while recreating notification subscription

When working with Office365 calendar folder subscription signatures, I get many ErrorReadEventsFailed messages in a SendNotification request. This error essentially means that the subscription is no longer found, and the server should no longer wait for new notifications.

Verification Microsoft recommended error handling , the solution is to use Autodiscover to reopen ExternalEwsUrl or EwsPartnerUrl and create a new subscription.

In Office365, AutoDiscovery seems almost impossible with the combination of OAuth2 service accounts, so I used https://outlook.office365.com/EWS/Exchange.asmx as the primary EWS endpoint.

However, when I try to create a new subscription for a specific calendar folder, I continue to receive a general 500 ErrorNoRespondingCASInDestinationSite error:

Exchange Web Services is currently unavailable for this request because none of the Client Access servers on the target site can process the request.

The strange part , this happens only after receiving the initial ErrorReadEventsFailed error . If I try again, say, 30 seconds, the request will pass without problems.

After some research, it seemed to most users to make sure that the X-AnchorMailbox was correctly configured for the user who the service account wants to impersonate. I double-checked this header, and it really does go on request for resubmission.

This problem can be solved by an exponential disconnecting solution, or simply repeat X the number of times until the request passes. It seems to me that when the subscription becomes "lost", the O365 service takes time to change the Exchange DNS server (this is the only thing I can think of).

Any help would be greatly appreciated!

+80
exchange-server exchangewebservices office365
Jul 20 '15 at 22:00
source share
1 answer

Given the documentation at: https://msdn.microsoft.com/en-us/library/office/dn458788(v=exchg.150).aspx

When a subscription is lost or is no longer available, it is better to create a new subscription and not include the old watermark in the new subscription. Re-subscribing to an old watermark causes a linear scan of events, which is expensive.

Instead, create a new subscription and map the folder properties to look for content changes that have occurred between the lost subscription and the new subscription. The advanced folder properties that we recommend you check are PR_LOCAL_COMMIT_TIME_MAX (0x670a0040) and PR_DELETED_COUNT_TOTAL (0x670b0003) .

You can do this by creating an extended property definition. I think this can help you!

+1
Nov 12 '17 at 18:24
source share



All Articles