You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
First a short note: I know that EWS for Exchange Online is discontinued and that MS Graph API should be used. We are going to switch to that, but it will take us some time. In the mean time we still have to support EWS for our customers. And I think the fix / Workaround could be quite simple, alas it can only implemented within the EWS managed API and not client code.
We observed the following symptom: Calling ExchangeService.SyncFolderItems failed for some users with the following exception and stack trace:
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.Exchange.WebServices.Data.SyncResponse`2.ReadElementsFromXml(EwsServiceXmlReader reader)
at Microsoft.Exchange.WebServices.Data.ServiceResponse.LoadFromXml(EwsServiceXmlReader reader, String xmlElementName)
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.ParseResponse(EwsServiceXmlReader reader)
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ParseResponse(EwsServiceXmlReader reader, WebHeaderCollection responseHeaders)
at Microsoft.Exchange.WebServices.Data.ServiceRequestBase.ReadResponse(EwsServiceXmlReader ewsXmlReader, WebHeaderCollection responseHeaders)
at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponseXml(Stream responseStream, WebHeaderCollection responseHeaders)
at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponse(IEwsHttpWebResponse response)
at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.InternalExecute()
at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
at Microsoft.Exchange.WebServices.Data.ExchangeService.SyncFolderItems(FolderId syncFolderId, PropertySet propertySet, IEnumerable`1 ignoredItemIds, Int32 maxChangesReturned, Int32 numberOfDays, SyncFolderItemsScope syncScope, String syncState)
at Microsoft.Exchange.WebServices.Data.ExchangeService.SyncFolderItems(FolderId syncFolderId, PropertySet propertySet, IEnumerable`1 ignoredItemIds, Int32 maxChangesReturned, SyncFolderItemsScope syncScope, String syncState)
I then asked the customer to provide an EWS Trace. This contained a lot of the well known <t:CalendarItem> elements, but far at the end an <t:Booking>, which seems to come from Microsoft Bookings . In parallel I had a look at the source of the EWS managed API and looked for a spot, where the NRE could occur. This then fell into my eye:
So my question is: What can we do, until we switch to Graph, to mitigate this? Is there any workaround we can implement on our side? Disabling Microsoft Bookings is no option. Honestly I fear there is no local workaround.
So would it be possible to provide a EWS managed API version that is more lenient in that regard and (maybe optionally) ignores new, unknown element types? The implementation would be quite simple. For me this just seems like a breaking change from Microsoft. We're quite stuck here ...
EDIT: This is what the Booking looks like, apart from the stuff after organizer much like a calendar item (XXXX where sensitive data was):
@SchultzAndreas Thanks for this. I ran into this as well, apparently when Booking is enabled on the account you can get this, did not see this before. I am running on a fork by @sherlock1982 so I added your fix to my own fork of that fork :-|
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
First a short note: I know that EWS for Exchange Online is discontinued and that MS Graph API should be used. We are going to switch to that, but it will take us some time. In the mean time we still have to support EWS for our customers. And I think the fix / Workaround could be quite simple, alas it can only implemented within the EWS managed API and not client code.
We observed the following symptom: Calling
ExchangeService.SyncFolderItems
failed for some users with the following exception and stack trace:I then asked the customer to provide an EWS Trace. This contained a lot of the well known
<t:CalendarItem>
elements, but far at the end an<t:Booking>
, which seems to come from Microsoft Bookings . In parallel I had a look at the source of the EWS managed API and looked for a spot, where the NRE could occur. This then fell into my eye:ews-managed-api/Core/Responses/SyncResponse.cs
Lines 153 to 155 in 25a393d
So in case
EwsUtilities.CreateEwsObjectFromXmlElementName<TServiceObject>
cannot provide an instance for the element it returnsdefault
(ews-managed-api/Core/EwsUtilities.cs
Line 309 in 25a393d
null
andews-managed-api/Core/Responses/SyncResponse.cs
Line 157 in 25a393d
t:booking
is registered hereews-managed-api/Core/ServiceObjects/ServiceObjectInfo.cs
Line 66 in 25a393d
It seems that this library had the same issue: ecederstrand/exchangelib#877
So my question is: What can we do, until we switch to Graph, to mitigate this? Is there any workaround we can implement on our side? Disabling Microsoft Bookings is no option. Honestly I fear there is no local workaround.
So would it be possible to provide a EWS managed API version that is more lenient in that regard and (maybe optionally) ignores new, unknown element types? The implementation would be quite simple. For me this just seems like a breaking change from Microsoft. We're quite stuck here ...
EDIT: This is what the Booking looks like, apart from the stuff after organizer much like a calendar item (XXXX where sensitive data was):
The text was updated successfully, but these errors were encountered: