There is a weird problem I'm facing when working with EWS Managed API 2.0 with Exchange Server 2007 SP3.
When I create an appointment and I save it, I get its ID using the following code :
appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);
appointment.Id.UniqueId;
and I store it in my local DB so I can later use it to update the meeting or cancel it.
Later when I want to retrieve the conflicting meetings I use the following code :
CalendarView view = new CalendarView(Start, End);
view.PropertySet = new PropertySet();
Folder rootfolder = Folder.Bind(service, WellKnownFolderName.Calendar);
//view.PropertySet.Add(AppointmentSchema.Resources);
view.PropertySet.Add(ItemSchema.Id);
view.PropertySet.Add(AppointmentSchema.Subject);
view.PropertySet.Add(AppointmentSchema.Start);
view.PropertySet.Add(AppointmentSchema.Duration);
view.PropertySet.Add(AppointmentSchema.End);
view.PropertySet.Add(AppointmentSchema.Organizer);
view.PropertySet.Add(AppointmentSchema.Id);
Mailbox mailbox = new Mailbox(Email);
FolderId id = new FolderId(WellKnownFolderName.Calendar, mailbox);
CalendarFolder folder = CalendarFolder.Bind(service, id);
FindItemsResults<Appointment> findResults = folder.FindAppointments(view);
//Iterating through the conflicting meetings returned by folder.FindAppointments
foreach (Appointment app in findResults.Items)
{
appts.Rows.Add(app.Subject, app.Start, app.End, app.Duration, app.Id.UniqueId);
}
and when I want to access the ID of one of the conflicting meetings I find it different than the ID I have it in my local DB although all other information are the same. I still can use my ID to bind to the appointment, but the problem is that the same meeting now have 2 different IDs. Why EWS isn't storing a unique ID for appointments why and (appointment.Id.UniqueId)is not constant ?
I didn't find a clear solution for this problem.