Independentsoft
- any library, any programming language
Home
Purchase
Support
Company
Contact
JWebServices for Exchange
>
Tutorial
> Add attendee
The following example shows you how to add attendee to an existing meeting.
import com.independentsoft.exchange.Appointment; import com.independentsoft.exchange.AppointmentPropertyPath; import com.independentsoft.exchange.Attendee; import com.independentsoft.exchange.ItemChange; import com.independentsoft.exchange.ItemId; import com.independentsoft.exchange.Property; import com.independentsoft.exchange.SendMeetingOption; import com.independentsoft.exchange.Service; import com.independentsoft.exchange.ServiceException; public class Example { public static void main(String[] args) { try { Service service = new Service("https://myserver/ews/Exchange.asmx", "username", "password"); Appointment appointment = service.getAppointment("AAMkAAAAAAAAYAABClH/p3xPfSLGfvkhFmBB/AAvTWJunAAA="); ItemId itemId = appointment.getItemId(); //remove ItemChange itemChange0 = new ItemChange(itemId); itemChange0.getPropertiesToDelete().add(AppointmentPropertyPath.REQUIRED_ATTENDEES); itemChange0.getPropertiesToDelete().add(AppointmentPropertyPath.OPTIONAL_ATTENDEES); itemId = service.updateItem(itemChange0); //add first ItemChange itemChange1 = new ItemChange(itemId); itemChange1.getPropertiesToSet().add(new Property(AppointmentPropertyPath.REQUIRED_ATTENDEES, new Attendee("John@mydomain.com"))); itemId = service.updateItem(itemChange1); //append others ItemChange itemChange2 = new ItemChange(itemId); itemChange2.getPropertiesToAppend().add(new Property(AppointmentPropertyPath.REQUIRED_ATTENDEES, new Attendee("Peter@mydomain.com"))); //send meeting update. itemId = service.updateItem(itemChange2, SendMeetingOption.SEND_TO_ALL); } catch (ServiceException e) { System.out.println(e.getMessage()); System.out.println(e.getXmlMessage()); e.printStackTrace(); } } }
Need help? Ask our developers:
Name*
Email*
Message*