如何通过使用EWS API Finditems操作或其他操作来获取修改后的事件? [英] How can I get a modified occurrence by using EWS API Finditems operation or other operations?

查看:64
本文介绍了如何通过使用EWS API Finditems操作或其他操作来获取修改后的事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?xml version =" 1.0"编码= QUOT; UTF-8英寸;?> 
< soap:Envelope xmlns:xsi =" http://www.w3.org/2001/XMLSchema-instance"的xmlns:M =" HTTP://schemas.microsoft.com/exchange/services/2006/messages"的xmlns:T =" HTTP://schemas.microsoft.com/exchange/services/2006/types"的xmlns:SOAP = QUOT; HTTP://schemas.xmlsoap.org/soap/envelope/">
< soap:Header>
< t:RequestServerVersion Version =" V2_75" />
< / soap:Header>
< soap:Body>
< m:FindItem Traversal =" Shallow">
< m:ItemShape>
< t:BaseShape> IdOnly< / t:BaseShape>
< t:AdditionalProperties>
< t:FieldURI FieldURI =" item:Subject" />
< t:FieldURI FieldURI =" item:LastModifiedTime" />
< t:FieldURI FieldURI =" calendar:UID" />
< / t:AdditionalProperties>
< / m:ItemShape>

< m:SortOrder>
< t:FieldOrder Order =" Ascending">
< t:FieldURI FieldURI =" item:LastModifiedTime" />
< / t:FieldOrder>
< / m:SortOrder>
< m:限制>
< t:IsGreaterThanOrEqualTo>
< t:FieldURI FieldURI =" item:LastModifiedTime" />
< t:FieldURIOrConstant>
< t:Constant Value =" 2015-12-21T00:00:00" />
< / t:FieldURIOrConstant>
< / t:IsGreaterThanOrEqualTo>
< / m:限制>
< m:ParentFolderIds>
< t:DistinguishedFolderId Id =" calendar" />
< / m:ParentFolderIds>
< / m:FindItem>
< / soap:Body>
< / soap:Envelope>

我正在使用此soap请求将日历项目从Exchange服务器同步到本地应用程序。当我开始处理重复项目时,我发现在我编辑了一个重复项目的出现后,这个soap请求只返回定期项目而不是
修改后的项目。


I尝试使用  ModifiedOccurrences,但这种方法效率不高。   ModifiedOccurrences可以告诉我所有修改过的事件,但我仍然不知道最新修改过的事件。


请帮我解决这个问题。谢谢。

解决方案

您可以使用
https://msdn.microsoft.com/en-us/library/office/cc979209.aspx 功能;.如果您使用日历视图,EWS将扩展定期约会,否则EWS将允许您使用InstanceIndex

https://msdn.microsoft.com/en-us/library /office/dn643672(v=exchg.150).aspx#sectionSection2
功能。

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
        <t:RequestServerVersion Version="V2_75" />
    </soap:Header>
    <soap:Body>
        <m:FindItem Traversal="Shallow">
            <m:ItemShape>
                <t:BaseShape>IdOnly</t:BaseShape>
                <t:AdditionalProperties>
                    <t:FieldURI FieldURI="item:Subject" />
                    <t:FieldURI FieldURI="item:LastModifiedTime" />
                    <t:FieldURI FieldURI="calendar:UID" />
                </t:AdditionalProperties>
            </m:ItemShape>
            
            <m:SortOrder>
                <t:FieldOrder Order="Ascending">
                    <t:FieldURI FieldURI="item:LastModifiedTime" />
                </t:FieldOrder>
            </m:SortOrder>
            <m:Restriction>
                <t:IsGreaterThanOrEqualTo>
                    <t:FieldURI FieldURI="item:LastModifiedTime" />
                    <t:FieldURIOrConstant>
                        <t:Constant Value="2015-12-21T00:00:00" />
                    </t:FieldURIOrConstant>
                </t:IsGreaterThanOrEqualTo>
            </m:Restriction>
            <m:ParentFolderIds>
                <t:DistinguishedFolderId Id="calendar" />
            </m:ParentFolderIds>
        </m:FindItem>
    </soap:Body>
</soap:Envelope>

I am using this soap request to sync the calendar items from Exchange server to local app. When I started to handle recurring items, I found that after I edited an occurrence of a recurring item, this soap request only returns the recurring item instead of modified occurrence.

I have tried to using the ModifiedOccurrences, but this approach is not efficient. The ModifiedOccurrences can tell me all modified occurrences, but I still don't know the latest modified occurrence.

Please help me on this one. Thank you.

解决方案

You can parse and process the PidLidAppointmentRecur property on the Master Instance using something https://msdn.microsoft.com/en-us/library/office/cc979209.aspx . EWS will expand the recurring appointment if you use a Calendar view, otherwise EWS will allow you to bind to a specific instance of an Appointment with a recurrence using the InstanceIndex https://msdn.microsoft.com/en-us/library/office/dn643672(v=exchg.150).aspx#sectionSection2 .


这篇关于如何通过使用EWS API Finditems操作或其他操作来获取修改后的事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆