Cannot modify appointment Hi All,
I use the zimbra client JAVA API to create/modify appointment via ZMailbox. Creation process works fine but when I try to modify the created appointment I get the following SOAP fault exception: com.zimbra.common.soap.SoapFaultException: The specified Invite is out of date (has been updated): f4e1413f-4c68-4198-a0d9-6b07325bb172:822
ExceptionId:btpool0-199://127.0.0.1:7071/service/admin/soap/ModifyAppointmentRequest:1282284464868:138b5fcd5ac b5cbf
Code:mail.INVITE_OUT_OF_DATE
My code source is as follow: ...
// get mail box
ZMailbox mailbox = ZMailbox.getMailbox(options);
/**
* create appointment
*/
// create message
ZMailbox.ZOutgoingMessage outgoingMessage = new ZOutgoingMessage();
// message subject
outgoingMessage.setSubject("Test zimbra JAVA client API");
// message part
outgoingMessage.setMessagePart(new MessagePart("text/plain", "This message may be deleted because it's just a test"));
// create invite
ZInvite invite = new ZInvite();
// create invite
ZComponent comp = new ZComponent();
// set start date to the current date and time
comp.setStart(new ZDateTime(ZimbraClientUtil.toVCalendarFormat(new Date())));
ZDuration duration = new ZDuration();
// set the default task's duration to 30 minutes
duration.setMinutes(30);
comp.setDuration(duration);
// set organizer
comp.setOrganizer(new ZOrganizer("aina"));
comp.setName("Task name");
comp.setLocation("Task location");
invite.getComponents().add(comp);
ZAppointmentResult appointmentResult = mailbox.createAppointment(ZFolder.ID_CALENDAR, null, outgoingMessage, invite, null);
/**
* modify the created appointment
*/
ZAppointmentResult result = mailbox.modifyAppointment(appointmentResult.getCal ItemId(), ZFolder.ID_CALENDAR, new ZDateTime(ZimbraClientUtil.toVCalendarFormat(new Date())), outgoingMessage, invite);
...
Please help to solve this problem. |