EWS - 如何在GetItemResponse中获取isRecurring信息

时间:2013-09-05 08:12:05

标签: java exchange-server exchangewebservices exchange-server-2010 ewsjavaapi

我在Java中使用EWS API进行Exchange Server通信。我订阅了Exchange服务器,并为Calendar文件夹添加了流订阅。我在创建会议并发送给我时收到通知。我想知道,如果我能在代码中学习此会议的isRecurring数据。当我使用getUserAvailability服务时,它会提供此数据。我可以在我的结构中得到它吗?

ItemEvents

// Now retrieve the Subject property of all the new mails in one call to EWS
ServiceResponseCollection<GetItemResponse> responses = service.bindToItems(
                       newMailsIds,
                       new PropertySet(ItemSchema.Subject, ItemSchema.MimeContent, ItemSchema.Body));

System.out.println("count=======" + responses.getCount());

for(GetItemResponse response : responses)
{
  System.out.println("count=======" + response.getClass().getName());
  System.out.println("subject=======" + response.getItem().getSubject());
  System.out.println("body=======" + response.getItem().getBody());
  System.out.println("mimecontent=======" + response.getItem().getMimeContent().toString());

  //Iterator itr = response.getItem().getExtendedProperties().iterator();
  //while (itr.hasNext()) 
  //{
  //    System.out.println("ExtendedProperties=======" + itr.next().toString());
  //}
}

1 个答案:

答案 0 :(得分:0)

由于您只订阅了Calendar-Folder,因此您可以直接将其绑定到Appointment对象::

  Appointment appointment = Appointment.bind(service, itemEvent.getItemId() , 
                     new PropertySet( AppointmentSchema.Subject, AppointmentSchema.Body,AppointmentSchema.IsRecurring ) );