Problem getting calendar event with recurring using EWS Java client API 1.2
I am using EWS 1.2 Java client API for getting calendar events. I am able to get Recurring information of the event which is created through API's 

appointment.save(), but not able to get recurring information of the event created in OWA interface, I get following error during the bind:

===================================

Exception: Connection not established

microsoft.exchange.webservices.data.EWSHttpException: Connection not established

at microsoft.exchange.webservices.data.HttpClientWebRequest.throwIfConnIsNull(HttpClientWebRequest.java:394)

at microsoft.exchange.webservices.data.HttpClientWebRequest.getResponseHeaders(HttpClientWebRequest.java:280)

at microsoft.exchange.webservices.data.ExchangeServiceBase.processHttpResponseHeaders(ExchangeServiceBase.java:1045)

at microsoft.exchange.webservices.data.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:58)

at microsoft.exchange.webservices.data.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:144)

at microsoft.exchange.webservices.data.ExchangeService.internalBindToItems(ExchangeService.java:1364)

at microsoft.exchange.webservices.data.ExchangeService.bindToItem(ExchangeService.java:1407)

at microsoft.exchange.webservices.data.ExchangeService.bindToItem(ExchangeService.java:1430)

at microsoft.exchange.webservices.data.Appointment.bind(Appointment.java:70)

at microsoft.exchange.webservices.data.Appointment.bindToRecurringMaster(Appointment.java:176)

at microsoft.exchange.webservices.data.Appointment.bindToRecurringMaster(Appointment.java:152)

============================

This happens if I use: Appointment.bindToRecurringMaster or Item.bind(service, id, appointmentProps) or findAppointments(). 

Works fine for events which doesn't have recurring. Only issue with events containing recurrence created through OWA. These are the propertySet:

new PropertySet(BasePropertySet.IdOnly,

                                ItemSchema.Subject,

                                AppointmentSchema.AppointmentType,

                                AppointmentSchema.DeletedOccurrences,

                                AppointmentSchema.FirstOccurrence,

                                AppointmentSchema.LastOccurrence,

                                AppointmentSchema.IsRecurring,

                                AppointmentSchema.Location,

                                AppointmentSchema.ModifiedOccurrences,

                                AppointmentSchema.OriginalStart,

                                AppointmentSchema.Recurrence,

                                AppointmentSchema.Start,

                                AppointmentSchema.End);

If I remove Recurrence it gives the response. 

Thanks.

April 29th, 2013 8:32pm

I am using EWS 1.2 Java client API for getting calendar events. I am able to get Recurring information of the event which is created through API's 

appointment.save(), but not able to get recurring information of the event created in OWA interface, I get following error during the bind:

===================================

Exception: Connection not established

microsoft.exchange.webservices.data.EWSHttpException: Connection not established

at microsoft.exchange.webservices.data.HttpClientWebRequest.throwIfConnIsNull(HttpClientWebRequest.java:394)

at microsoft.exchange.webservices.data.HttpClientWebRequest.getResponseHeaders(HttpClientWebRequest.java:280)

at microsoft.exchange.webservices.data.ExchangeServiceBase.processHttpResponseHeaders(ExchangeServiceBase.java:1045)

at microsoft.exchange.webservices.data.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:58)

at microsoft.exchange.webservices.data.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:144)

at microsoft.exchange.webservices.data.ExchangeService.internalBindToItems(ExchangeService.java:1364)

at microsoft.exchange.webservices.data.ExchangeService.bindToItem(ExchangeService.java:1407)

at microsoft.exchange.webservices.data.ExchangeService.bindToItem(ExchangeService.java:1430)

at microsoft.exchange.webservices.data.Appointment.bind(Appointment.java:70)

at microsoft.exchange.webservices.data.Appointment.bindToRecurringMaster(Appointment.java:176)

at microsoft.exchange.webservices.data.Appointment.bindToRecurringMaster(Appointment.java:152)

============================

This happens if I use: Appointment.bindToRecurringMaster or Item.bind(service, id, appointmentProps) or findAppointments(). 

Works fine for events which doesn't have recurring. Only issue with events containing recurrence created through OWA. These are the propertySet:

new PropertySet(BasePropertySet.IdOnly,

                                ItemSchema.Subject,

                                AppointmentSchema.AppointmentType,

                                AppointmentSchema.DeletedOccurrences,

                                AppointmentSchema.FirstOccurrence,

                                AppointmentSchema.LastOccurrence,

                                AppointmentSchema.IsRecurring,

                                AppointmentSchema.Location,

                                AppointmentSchema.ModifiedOccurrences,

                                AppointmentSchema.OriginalStart,

                                AppointmentSchema.Recurrence,

                                AppointmentSchema.Start,

                                AppointmentSchema.End);

If I remove Recurrence it gives the response. 

Thanks.

I am also facing the same problem.. If anyone can help, it would be helpful. I can see the response xml has the data, but while parsing the xml the error is generated in getResponseCode() in HttpClientWebRequest
Free Windows Admin Tool Kit Click here and download it now
January 30th, 2014 9:17am

Was anyone able to solve this?
February 6th, 2014 9:30pm

Hi, I was experiencing this same problem and after reading another site (http://code.msdn.microsoft.com/Exchange-EWS-Java-API-12-1a5a1143/view/Discussions#content) and discovering that the "Connection not established" error is not the true error, I was able to trace down the true error.  It turns out the datetime values for the recurring meeting dates are passed through the ExchangeServiceBase.convertStartDateToUnspecifiedDateTime() method which says it supports 3 different formats but really only supports one format (one that ends in Z).  The datetimes are instead formatted like 2014-06-11-5:00 so the DateFormat object threw an exception trying to parse it.  The code below is how I fixed it to function as the comments say it should:

  protected Date convertStartDateToUnspecifiedDateTime(String value) throws ParseException {
    if (value == null || value.isEmpty()) {
      return null;
    } else {
      DateFormat df = null;
      if (value.contains("Z")) {
        df = new SimpleDateFormat("yyyy-MM-dd'Z'");
      } else if (value.matches("/\\-[0-9]{2}:[0-9]{2}^/")) {
        df = new SimpleDateFormat("yyyy-MM-ddXXX");
      } else {
        df = new SimpleDateFormat("yyyy-MM-dd");
      }
      return df.parse(value);
    }
  }

Hope this helps save others headaches.

Free Windows Admin Tool Kit Click here and download it now
June 11th, 2014 6:47pm

Even I am facing the same problem.Thanks a lot for your comment. 
February 19th, 2015 10:34am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics