EWS Managed API 1.1, Exchange 2007_SP1 BindToRecurringMaster throws exception because of appointment TimeZone null RRS feed

  • Question

  • Hi


    I'm using EWS Managed API to sync appointments from Outlook calendar.

    Recently I have some errors reported from clients saying "Value cannot be null. Parameter name: id".

    My logs shows  the call stack that I included at the bottom.

    Debugging, I found out that whenever I try to get a RecurringMaster starting from the id of one of its occurrence (either if it's by using BindToRecurringMaster  or  by "RecurringAppointmentMasterId recMasterid = new RecurringAppointmentMasterId(new ItemId(idOfOccurrence.UniqueId).ToString()); master = Appointment.Bind(binding, recMasterid);" ) , IF the TimeZone of the ocurrence is null then I will get an exception thrown when trying to get the RecurringMaster.


    Now two questions:

    1.) Does anybody know how can it be that the TimeZone of the appointment ended up null ?

    2.)  How can I obtainteh recurringMaster Id, starting from such an occurrence that has null TimeZone

    3.) I thought that I could get round this by identifying if the TimeZone is null before trying to get the recurring master and setting ot myself to TimeZone.Local.

    As appointment.TimeZone doesn't have a setter I tried to update the StartTimeZone value. Unfortunatelly, setting StartTimeZone  to non null doesn't seem to help as TimeZone still remains null.

    How can I update the appointment.TimeZone ?



    Call stack showing BindToRecurringMaster broken by TimeZone being null:

    11.41.57 Value cannot be null.
    Parameter name: id
       at System.TimeZoneInfo.GetTimeZone(String id)
       at System.TimeZoneInfo.FindSystemTimeZoneById(String id)
       at Microsoft.Exchange.WebServices.Data.MeetingTimeZone.ToTimeZoneInfo()
       at Microsoft.Exchange.WebServices.Data.MeetingTimeZonePropertyDefinition.LoadPropertyValueFromXml(EwsServiceXmlReader reader, PropertyBag propertyBag)
       at Microsoft.Exchange.WebServices.Data.PropertyBag.LoadFromXml(EwsServiceXmlReader reader, Boolean clear, PropertySet requestedPropertySet, Boolean onlySummaryPropertiesRequested)
       at Microsoft.Exchange.WebServices.Data.EwsServiceXmlReader.ReadServiceObjectsCollectionFromXml[TServiceObject](String collectionXmlElementName, GetObjectInstanceDelegate`1 getObjectInstanceDelegate, Boolean clearPropertyBag, PropertySet requestedPropertySet, Boolean summaryPropertiesOnly)
       at Microsoft.Exchange.WebServices.Data.GetItemResponse.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.ReadResponse(EwsServiceXmlReader ewsXmlReader)
       at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.ReadResponse(HttpWebResponse response)
       at Microsoft.Exchange.WebServices.Data.SimpleServiceRequestBase.InternalExecute()
       at Microsoft.Exchange.WebServices.Data.MultiResponseServiceRequest`1.Execute()
       at Microsoft.Exchange.WebServices.Data.ExchangeService.InternalBindToItems(IEnumerable`1 itemIds, PropertySet propertySet, ServiceErrorHandling errorHandling)
       at Microsoft.Exchange.WebServices.Data.ExchangeService.BindToItem(ItemId itemId, PropertySet propertySet)
       at Microsoft.Exchange.WebServices.Data.ExchangeService.BindToItem[TItem](ItemId itemId, PropertySet propertySet)
       at Microsoft.Exchange.WebServices.Data.Appointment.BindToRecurringMaster(ExchangeService service, ItemId occurrenceId, PropertySet propertySet)
       at Microsoft.Exchange.WebServices.Data.Appointment.BindToRecurringMaster(ExchangeService service, ItemId occurrenceId)
       at Formula.Connectors.ExchangeEWSAPIHandler.GetAppointments(ExchangeService exchangeServiceBind, String calendarName)

    Monday, November 22, 2010 1:10 AM

All replies

  • Hi,

    Today we started experiencing the same problem in one of our applications (in Production Environment). I would highly appreciate any information on this one.




    Tuesday, December 7, 2010 6:19 PM
  • Glad to hear that somebody else is getting this problem.

    Not glad that you have it, just glad to hear I'm not the only one.


    As I didn't get any feedback on this, I reposted it with an improved header at:

    Note that I tried with the Managed API 1.1 FINAL ( oinitially I was using 1.1 beta) and the very same issue occurs.


    If anybody at MSFT has an idea abt this, your feedback is more than wellcomed.

    Same as cypressx above, I'm getting tis in production at a customer :(


    Thursday, December 9, 2010 2:05 PM
  • I have the same problem, but it only seems to happen with appointments created on a mobile device (tested it with an iPhone 4 and a Samsung Galaxy S). Appointments created with Outlook 2007/2010 and/or OWA seem to fine here.
    Monday, September 5, 2011 6:27 AM