首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Exchange EWS -如何从特定日期的主事件中检索事件?

Exchange EWS -如何从特定日期的主事件中检索事件?
EN

Stack Overflow用户
提问于 2013-01-02 21:05:01
回答 1查看 1.3K关注 0票数 1

我想从某个特定日期(我有发生日期和重复出现的主事件数据)的定期主日历事件中检索事件(ItemID)。

我在尝试FindItem时遇到了这样的限制

代码语言:javascript
复制
<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‘属性无效-根据其数据类型(类型:UnindexedFieldURIType),值'item:RecurringMasterItemId’无效-枚举约束失败。

(我也知道定期约会的ChangeKey,并尝试了它,但出现了相同的错误)

应该如何修复这个问题才能使其正常工作?

顺便说一句。我知道如何使用GetItem检索事件,如下所示:

代码语言:javascript
复制
<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>

然后,我可以检索StartDate并遍历它们,但我无法预测可能适用的InstanceIndex范围。

提前谢谢你,

1月

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-01-14 23:50:02

看起来这是不可能的。

我现在求助于使用GetItem,一次检索50个匹配项。

这将返回包含以下任一内容的GetItemResponseMessages列表:

real responsecode Succesful retrievals

  • ErrorCalendarOccurrenceIndexIsOutOfRecurrenceRange occurrence

  • Other指示我们已到达最后一个真实的errors

  • ErrorCalendarOccurrenceIsDeletedFromRecurrence响应码,表明该事件已被删除

所以我只是循环,直到我找到合适的日期,达到ErrorCalendarOccurrenceIndexIsOutOfRecurrenceRange,或达到我代码中设置的最大调用次数。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14122601

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档