我正在尝试从会议室会议中获取完整的会议详细信息。下面的代码适用于用户的日历,但是当我将日历更改为会议室(资源日历)时,它不会返回所有信息(特别是会议“主题”和“正文”。
我正在使用的用户(在凭据部分)具有“发现管理”角色以及对房间日历的“完全访问权限”,但这似乎仍然指向权限。
我还尝试添加以下模拟但没有成功:
ImpersonatedUserId uidSMTP = new ImpersonatedUserId(ConnectingIdType.SmtpAddress,”MeetingRoom@Domain.com");
service.setImpersonatedUserId(uidSMTP);
任何想法将不胜感激!
ExchangeService service = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials(“User@Domain.com", “Password”);
service.setCredentials(credentials);
service.setUrl(new URI("https://outlook.office365.com/EWS/Exchange.asmx"));
EmailAddress emAddr = new EmailAddress("MeetingRoom@Domain.com");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String td1 = "2015-12-23 15:00:00";
String td2 = "2015-12-23 23:00:00";
Date d1 = format.parse(td1);
Date d2 = format.parse(td2);
CalendarView cView = new CalendarView(d1,d2);
PropertySet prop = new PropertySet();
cView.setPropertySet(prop);
FolderId folderId = new FolderId(WellKnownFolderName.Calendar, new Mailbox(emAddr.getAddress()));
FindItemsResults<Appointment> findResults = service.findAppointments(folderId, cView);
ArrayList<Appointment> calItem = findResults.getItems();
PropertySet itemPropertySet = new PropertySet(BasePropertySet.FirstClassProperties);
itemPropertySet.setRequestedBodyType(BodyType.Text);
int numItems = findResults.getTotalCount();
for (int i=0;i<numItems;i++) {
Appointment Details = Appointment.bind(service, calItem.get(i).getId(),itemPropertySet);
calItem.get(i).load();
System.out.println(calItem.get(i).getOrganizer().getName());
System.out.println(calItem.get(i).getStart());
System.out.println(calItem.get(i).getEnd());
System.out.println(calItem.get(i).getSubject());
System.out.println(calItem.get(i).getDisplayTo());
System.out.println(calItem.get(i).getLocation());
System.out.println(Details.getBody());
}