I am using the Microsoft EWS Java API to create and accept appointments on behalf of some users. The way I am doing this is by sending the meeting request and then setting up inbox watchers on the recipient's inbox and accepting the incoming MeetingRequest
item:
import microsoft.exchange.webservices.data.core.service.item.MeetingRequest;
void accept(MeetingRequest request) {
assert(!request.getIsOutOfDate());
request.accept(false);
}
However, I get this error when I try to accept the meeting request:
microsoft.exchange.webservices.data.core.exception.service.remote.ServiceResponseException: The meeting request is out of date. The calendar couldn't be updated.
at microsoft.exchange.webservices.data.core.response.ServiceResponse.internalThrowIfNecessary(ServiceResponse.java:278)
at microsoft.exchange.webservices.data.core.response.ServiceResponse.throwIfNecessary(ServiceResponse.java:267)
at microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:165)
at microsoft.exchange.webservices.data.core.ExchangeService.internalCreateResponseObject(ExchangeService.java:270)
at microsoft.exchange.webservices.data.core.service.response.ResponseObject.internalCreate(ResponseObject.java:120)
at microsoft.exchange.webservices.data.core.service.response.CalendarResponseMessageBase.calendarSave(CalendarResponseMessageBase.java:98)
at microsoft.exchange.webservices.data.core.service.item.MeetingRequest.internalAccept(MeetingRequest.java:218)
at microsoft.exchange.webservices.data.core.service.item.MeetingRequest.accept(MeetingRequest.java:184)
This corresponds to this error: ErrorMeetingRequestIsOutOfDate
. I looked at MSDN for this error and could not find why this error might be happening to me.
What am I doing wrong?