We are having problems with the EWS Managed API and Office 365.
When trying to get calendar items from a calendar folder for a user that does not exist on Office 365, the EWS Managed API fails when trying to parse the result.
The same scenario against a local Exchange 2010 server works fine - the expected result is that EWS returns a FindItemResponseMessage with the MessageText "The SMTP address has no mailbox associated with it.".
This began occurring on a service that has worked fine for months. It started on 2013-09-11 at 21:19 CET. I assume that the Office 365 account that we encountered the problem with was updated or something at the time.
The difference between the response from a local Exchange 2010 server and the one from Office 365 is the order of the XML elements in the FindItemResponseMessage.
The local Exchange returns the elements in this order:
MessageText, ResponseCode, DescriptiveLinkKey, MessageXml
Office 365 returns the elements in this order:
MessageXml, MessageText, ResponseCode, DescriptiveLinkKey
In the reponse from Office 365, the MessageXml element is returned first. The values of the elements are the same.
But apparently EWS Managed API expectes the MessageText element first. Otherwise it raises a ServiceXmlDeserializationException like this one:
I've tried Microsoft.Exchange.WebServices.dll versions 14.3.67.1 supplied with the August 2012 EWSEditor release and version 15.0.516.14 with the same results.
Other than catching the ServiceXmlDeserializationException, what can I do to make the EWS Managed API handle this better?
When trying to get calendar items from a calendar folder for a user that does not exist on Office 365, the EWS Managed API fails when trying to parse the result.
The same scenario against a local Exchange 2010 server works fine - the expected result is that EWS returns a FindItemResponseMessage with the MessageText "The SMTP address has no mailbox associated with it.".
This began occurring on a service that has worked fine for months. It started on 2013-09-11 at 21:19 CET. I assume that the Office 365 account that we encountered the problem with was updated or something at the time.
The difference between the response from a local Exchange 2010 server and the one from Office 365 is the order of the XML elements in the FindItemResponseMessage.
The local Exchange returns the elements in this order:
MessageText, ResponseCode, DescriptiveLinkKey, MessageXml
Office 365 returns the elements in this order:
MessageXml, MessageText, ResponseCode, DescriptiveLinkKey
In the reponse from Office 365, the MessageXml element is returned first. The values of the elements are the same.
But apparently EWS Managed API expectes the MessageText element first. Otherwise it raises a ServiceXmlDeserializationException like this one:
An element node 'm:MessageText' of the type Element was expected, but node 'm:MessageXml' of type Element was found. at Microsoft.Exchange.WebServices.Data.EwsXmlReader.InternalReadElement(XmlNamespace xmlNamespace, String localName, XmlNodeType nodeType) at Microsoft.Exchange.WebServices.Data.EwsXmlReader.ReadElementValue(XmlNamespace xmlNamespace, String localName) 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.ReadResponse(EwsServiceXmlReader ewsXmlReader) at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponse(IEwsHttpWebResponse response) at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute() at Microsoft.Exchange.WebServices.Data.ExchangeService.FindAppointments(FolderId parentFolderId, CalendarView calendarView)
I've tried Microsoft.Exchange.WebServices.dll versions 14.3.67.1 supplied with the August 2012 EWSEditor release and version 15.0.516.14 with the same results.
Other than catching the ServiceXmlDeserializationException, what can I do to make the EWS Managed API handle this better?