无法从Exchange Web服务检索资源(会议室)

use*_*947 6 c# service exchange-server exchangewebservices

我很难过.我正在使用Exchange Web服务从我公司的本地日历和其他日历中检索日历信息,但".Resources"始终为空.我们使用Resources来存储会议室信息.有趣的是,即使".RequiredAttendees"也是空的,但我可以毫无问题地从".DisplayTo"和".DisplayCc"中检索值.有什么建议?我在下面附上了一个应付片段以供参考.

  CalendarView calendarView = new CalendarView(startDate, endDate);
  Mailbox mailbox = new Mailbox(mailboxSMTP);
  FolderId calendarFolder = new FolderId(WellKnownFolderName.Calendar, mailbox);
  FindItemsResults<Appointment> findResults = service.FindAppointments(calendarFolder, calendarView);

  foreach (Appointment appointment in findResults.Items)
  {// foreach 1
      ...
Run Code Online (Sandbox Code Playgroud)

谢谢,格雷格

小智 1

默认情况下,EWS 可能不会请求该Resources属性,但您应该能够通过将其添加到PropertySet调用之前来明确请求该属性FindAppointments

calendarView.PropertySet.Add(AppointmentSchema.Resources);
Run Code Online (Sandbox Code Playgroud)

  • 嗨杰森。感谢您的帮助。调用 AppointmentSchema.Resources 引发了异常,但它确实为我指明了正确的方向。本文(http://blogs.msdn.com/b/exchangedev/archive/2010/03/16/loading-properties-for-multiple-items-with-one-call-to-exchange-web-services.aspx )展示了如何以一种我“永远”无法仅使用 API 文档弄清楚的方式获取预约资源...... (2认同)