2013-01-02 102 views
1

我想从特定日期(具有发生日期和定期主事件数据)的循环主日历事件中检索事件(ItemID)。Exchange EWS - 如何从特定日期的主事件中检索事件?

我试图的FindItem像这样

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages"> 
    <soapenv:Header> 
     <typ:RequestServerVersion Version="Exchange2007_SP1"/> 
    </soapenv:Header> 
    <soapenv:Body> 
     <mes:FindItem Traversal="Shallow"> 
     <mes:ItemShape> 
      <typ:BaseShape>AllProperties</typ:BaseShape> 
     </mes:ItemShape> 
     <mes:Restriction> 
      <typ:IsEqualTo> 
       <typ:FieldURI FieldURI="item:RecurringMasterItemId"/> 
       <typ:FieldURIOrConstant> 
       <typ:Constant Value="AQMkAD[snip]AAAAA=="/> 
       </typ:FieldURIOrConstant> 
      </typ:IsEqualTo> 
     </mes:Restriction> 
     <mes:ParentFolderIds> 
      <typ:DistinguishedFolderId Id="calendar"/> 
     </mes:ParentFolderIds> 
     </mes:FindItem> 
    </soapenv:Body> 
</soapenv:Envelope> 

的限制,但这返回: 的“FieldURI”属性无效 - 值“项目:RecurringMasterItemId”是无效的,根据其数据类型(类型:UnindexedFieldURIType ) - 枚举约束失败。
(我也知道定期约会的ChangeKey并尝试过,发生同样的错误)

这应该如何解决才能使其工作?

顺便说一句。我知道与检索的GetItem出现这样的:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages"> 
    <soapenv:Header> 
     <typ:RequestServerVersion Version="Exchange2007_SP1"/> 
    </soapenv:Header> 
    <soapenv:Body> 
     <mes:GetItem> 
     <mes:ItemShape> 
      <typ:BaseShape>IdOnly</typ:BaseShape> 
     </mes:ItemShape> 
     <mes:ItemIds> 
      <typ:OccurrenceItemId RecurringMasterId="AQMkAD[snip]AAAA==" InstanceIndex="1"/> 
      <typ:OccurrenceItemId RecurringMasterId="AQMkAD[snip]AAAA==" InstanceIndex="2"/> 
      <typ:OccurrenceItemId RecurringMasterId="AQMkAD[snip]AAAA==" InstanceIndex="3"/> 
     </mes:ItemIds> 
     </mes:GetItem> 
    </soapenv:Body> 
</soapenv:Envelope> 

然后,我可能会通过这些检索起始日期和循环,但没有办法,我可以预测可能适用的范围InstanceIndex。

由于提前,

+0

如果任何人有EWS托管API代码来做到这一点,也可能帮助我.... –

回答

0

它看起来并不像这是可能的。

我现在已经使用GetItem,一次检索50个事件。

这将返回GetItemResponseMessages包含列表之一:

  • 成功的发生检索

  • ErrorCalendarOccurrenceIndexIsOutOfRecurrenceRange responsecode表明我们已经到达了最后一次出现

  • 其他 '真正的' 错误

  • 错误CalendarOccurrenceIsDeletedFromRecurrence responsecode表明发生被删除

所以我只是循环,直到我找到了正确的日期,达到ErrorCalendarOccurrenceIndexIsOutOfRecurrenceRange,或达到了我的代码中设置呼叫的最大数量。

相关问题