【问题标题】:Can't Retrieve Resources (rooms) from Exchange Web Services无法从 Exchange Web 服务检索资源(房间)
【发布时间】:2012-09-26 21:16:09
【问题描述】:

我被难住了。我正在使用 Exchange Web 服务从我公司的本地日历和其他日历中检索日历信息,但“.Resources”始终为空。我们使用资源来存储会议室信息。有趣的是,即使“.RequiredAttendees”是空的,但我可以毫无问题地从“.DisplayTo”和“.DisplayCc”中检索值。有什么建议么?我在下面包含了一个应对 sn-p 以供参考。

  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
      ...

谢谢, 格雷格

【问题讨论】:

    标签: c# service exchange-server exchangewebservices


    【解决方案1】:

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

    calendarView.PropertySet.Add(AppointmentSchema.Resources);
    

    【讨论】:

    • 嗨杰森。谢谢你的帮助。调用 AppointmentSchema.Resources 引发了异常,但它确实为我指明了正确的方向。这篇文章 (blogs.msdn.com/b/exchangedev/archive/2010/03/16/…) 展示了如何以一种我仅使用 API 文档就从未想出的方式获取约会资源......
    • 所以也许写解决方案?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-12-31
    • 1970-01-01
    • 2018-07-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多