EWSConnectorFactory factory = new EWSConnectorFactory();
EWSConnectorInterface connector = null;
connector = factory.createEWSConnector(_exchangeHost,
_userName,
_password,
_prefix, _useSSL, _accountName);
SimpleDateFormat dateFormat = new SimpleDateFormat(
"yyyy-MM-dd HH:mm:ss");
Date startDate = null;
Date endDate = null;
startDate = dateFormat.parse("2014-12-31 23:00:00");
endDate = dateFormat.parse("2014-12-31 23:30:00");
EWSEventDTO event = new EWSEventDTO();
event.setSubject("test event2");
event.setStartDate(startDate);
event.setEndDate(endDate);
String xmlRecurrenceRule = "<t:Recurrence><t:DailyRecurrence><t:Interval>1</t:Interval>"
+ "</t:DailyRecurrence><t:NumberedRecurrence>"
+ "<t:StartDate>2014-12-31Z</t:StartDate>"
+ "<t:NumberOfOccurrences>5</t:NumberOfOccurrences>"
+ "</t:NumberedRecurrence></t:Recurrence>";
EWSRecurrence ewsRecurrence = new EWSRecurrence( xmlRecurrenceRule );
event.setRecurrenceRule( ewsRecurrence );
event.setRecurrent( true );
String[] result = null;
try {
result = connector.createEvent(event);
System.out.println("id: " + result[0]);
System.out.println("changeKey: " + result[1]);
} catch (Exception e) {
e.printStackTrace();
}
Hi,
Try to update the event to add timezone.
Please see the related timezone examples.
Best Regards,
Jonathan Sanders,
NetComps LTD
--
You received this message because you are subscribed to the Google Groups "jec users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jec-users2+...@googlegroups.com.
To post to this group, send email to jec-u...@googlegroups.com.
Visit this group at http://groups.google.com/group/jec-users2.
For more options, visit https://groups.google.com/d/optout.