使用 Exchange 中的 EWS 执行分页搜索Perform paged searches by using EWS in Exchange

了解如何在面向 Exchange 的 EWS 托管 API 或 EWS 应用程序中执行分页搜索。Find out how to perform paged searches in your EWS Managed API or EWS application that targets Exchange.

分页是 EWS 中的一项功能,可用于控制搜索结果的大小。Paging is a feature in EWS that enables you to control the size of the results of a search. 无需通过 EWS 响应检索整个结果集,可通过多个 EWS 响应检索小型集。Rather than retrieve the entire result set in one EWS response, you can retrieve smaller sets in multiple EWS responses. 例如,如果用户的收件箱中有 10,000 封电子邮件。For example, consider a user with 10,000 email messages in their Inbox. 理论上你可以在一个极大的响应中检索所有 10,000 封电子邮件,但出于带宽或性能原因,可能需要将其分解为更易管理的区块。Hypothetically, you could retrieve all 10,000 emails in one very large response, but you might want to break that up into more manageable chunks for bandwidth or performance reasons. 分页为你提供了执行此操作的工具。Paging gives you the tools to do just that.

备注

虽然理论上你可以在一个请求中检索 10,000 个项,但实际上,由于 EWS 限制,这不太可能发生。While you can hypothetically retrieve 10,000 items in one request, in reality, this is unlikely due to EWS throttling. 若要了解详细信息,请参阅 Exchange 中的 EWS 限制To find out more, see EWS throttling in Exchange.

表1. EWS 托管 API 和 EWS 中的分页参数Table 1. Paging parameters in the EWS Managed API and EWS

若要配置或检索…To configure or retrieve the… 在 EWS 托管 API 中,使用…In the EWS Managed API, use… 在 EWS 中,使用…In EWS, use…
响应中项目或文件夹的最大数量Maximum number of items or folders in a response
ItemView 构造函数或 FolderView 构造函数的 pageSize 参数The pageSize parameter to the ItemView constructor or the FolderView constructor
Or
PagedView PageSize 属性The PagedView.PageSize property
IndexedPageItemView 元素或 IndexedPageFolderView 元素上的 MaxEntriesReturned 属性The MaxEntriesReturned attribute on the IndexedPageItemView element or the IndexedPageFolderView element
项目或文件夹列表中的起始点Starting point in the list of items or folders
ItemView 构造函数或 FolderView 构造函数的 offsetBasePoint 参数The offsetBasePoint parameter to the ItemView constructor or the FolderView constructor
Or
PagedView.OffsetBasePoint 属性The PagedView.OffsetBasePoint property
IndexedPageItemView 元素或 IndexedPageFolderView 元素上的 BasePoint 属性The BasePoint attribute on the IndexedPageItemView element or the IndexedPageFolderView element
起始点偏移Offset from the starting point
ItemView 构造函数或 FolderView 构造函数的 offset 参数The offset parameter to the ItemView constructor or the FolderView constructor
Or
PagedView.Offset 属性The PagedView.Offset property
IndexedPageItemView 元素或 IndexedPageFolderView 元素上的 Offset 属性The Offset attribute on the IndexedPageItemView element or the IndexedPageFolderView element
服务器上的总结果数Total number of results on the server
FindItemsResults TotalCount 属性或 FindFoldersResults 属性The FindItemsResults.TotalCount property or the FindFoldersResults.TotalCount property
RootFolder (FindItemResponseMessage) 元素或 RootFolder (FindFolderResponseMessage) 元素上的 TotalItemsInView 属性The TotalItemsInView attribute on the RootFolder (FindItemResponseMessage) element or the RootFolder (FindFolderResponseMessage) element
当前响应中未包含的第一个项目或文件夹的偏移量Offset of first item or folder not included in current response
FindItemsResults NextPageOffset 属性或 FindFoldersResults 属性The FindItemsResults.NextPageOffset property or the FindFoldersResults.NextPageOffset property
RootFolder 元素上的 IndexedPagingOffset 属性The IndexedPagingOffset attribute on the RootFolder element
响应包括列表中的最后一个项目或文件夹的指示器Indicator that response includes the last item or folder in the list
FindItemsResults.MoreAvailable 属性或 FindFoldersResults.MoreAvailable 属性The FindItemsResults.MoreAvailable property or the FindFoldersResults.MoreAvailable property
RootFolder 元素上的 IncludesLastItemInRange 属性The IncludesLastItemInRange attribute on the RootFolder element

分页工作方式How paging works

为了理解分页的工作方式,可以将文件夹中的邮件想象成户外并排排列的广告牌。To understand how paging works, it's helpful to visualize the messages in a folder as billboards lined up side by side in a field outside your house. 你可以透过一扇神奇的窗口看到这些广告牌。You can see some of these billboards through a magical window. 你可以更改窗口的大小(一次看到更多或更少的广告牌),也可以移动窗口(控制你可以看到哪些广告牌)。You have the ability to change the size of the window (to see more or fewer billboards at once) and to move the window (to control which billboards you can see). 窗口的这种操作就是分页。This manipulation of the window is paging.

将请求发送到 Exchange 服务器时,可根据要返回的项目数来指定窗口的大小。When you send your request to the Exchange server, you specify the size of your window in terms of how many items to return. 可以通过指定起始点(行首或行尾)和从起始点的偏移量(用许多项表示)来设置窗口的位置。You set the position of the window by specifying a starting point (either the beginning of the line or the end of the line) and an offset from that starting point, expressed in a number of items. 窗口开头是指从起始点到偏移量指定的项目数。The beginning of the window is the number of items specified by the offset from the starting point.

分页的有趣之处在于服务器的响应,以及应用程序如何使用该响应来形成它的下一个请求。Where paging gets a bit more interesting is in the server's response, and how your application can use that response to shape its next request. 服务器提供了三种信息,可用于确定如何为下一次请求配置“窗口”:The server gives you three pieces of information that you can use to determine how to configure your "window" for your next request:

  • 响应中的结果是否包含服务器上总体结果集中的最后一项。Whether the results in the response include the last item in the overall result set on the server.

  • 服务器上的结果集中的项目总数。The total number of items in the result set on the server.

  • 如果你想将窗口推进到未包含在当前响应中的结果集中的下一个项目,下一个偏移值应该是什么。What the next offset value should be, if you want to advance your window to the next item in the result set that isn't included in the current response.

让我们看一个简单的示例。Let's look at a simple example. 假设出收件箱中有 15 封邮件。Imagine an Inbox with 15 messages in it. 应用程序将初始请求检索到最多 10 个项目,从邮件列表的开头开始(因此偏移量为零)。Your application sends an initial request to retrieve a maximum of 10 items, starting at the beginning of the list of messages (so the offset is zero). 服务器响应前 10 封邮件,显示该响应不包括最后一个项目,共有 15 个项目,下一个偏移量应为 10。The server responds with the first 10 messages, and indicates that the response does not include the last item, that there are a total of 15 items, and that the next offset should be 10.

图 1. 从包含 15 个项目的列表开头处开始,以偏移量 0 请求 10 个项目Figure 1. Requesting 10 items at offset 0 from the beginning of a list of 15 items

此图显示从包含 15 个项目的列表开始,在偏移量为 0 的情况下,请求 10 个项目的结果。

然后,你的应用程序将相同的请求重新发送到服务器,唯一的变化是偏移量现在是10。Your application then resends the same request to the server, with the only change being that the offset is now 10. 服务器返回最后 5 个项目,并指示响应包含最后一个条目,总共有 15 个项目,下一个偏移量应该是 15(当然,已经到达了末尾,所以不会有下一个偏移量)。The server returns the last five items, and indicates that the response does include the last item, that there are a total of 15 items, and that the next offset should be 15 (though of course, you've reached the end, so there won't be a next offset.)

图 2. 从包含 15 个项目的列表开头处开始,以偏移量 10 请求 10 个项目Figure 2. Requesting 10 items at offset 10 from the beginning of a list of 15 items

此图显示从包含 15 个项目的列表开始,在偏移量为 10 的情况下,请求 10 个项目的结果。

分页的设计注意事项Design considerations for paging

若要在应用程序中充分利用分页,需要考虑一些事项。Making the most out of paging in your application does require some consideration. 例如,将“窗口”设置为多大?For example, how large do you make your "window"? 如果在移动“窗口”时服务器上的结果发生变化,该怎么办?What do you do if the results on the server change while you're moving your "window"?

确定窗口的大小Determine the size of your window

没有所有应用程序都可使用的“一刀切”的最大条目数。There is no "one-size-fits-all" maximum number of entries that all applications should use. 确定适合你的应用程序的数目取决于几个不同的因素。Determining the number that's right for your application depends on several different factors. 但是,请牢记以下准则,这很有帮助:However, it's helpful to keep the following guidelines in mind:

  • 默认情况下,Exchange 将单个请求中可以返回的最大项数限制为 1000。By default, Exchange limits the maximum number of items that can be returned in a single request to 1000.

  • 将条目的最大数量设置得越大,获取所有条目要发送的请求就越少,而响应时间会更长。Setting the maximum number of entries to a larger number results in having to send fewer requests to get all items, at the cost of having to wait longer for responses.

  • 将条目的最大数量设置得越小,响应时间会越快,为了获取所有条目就要发送更多请求。Setting the maximum number of entries to a smaller number results in quicker response times, at the cost of having to send more requests to get all items.

处理对结果集所做的更改Handling changes to the result set

在本文前面的简单示例中,用户的收件箱中的项目数保持不变。In the simple example earlier in this article, the number of items in the user's Inbox remained constant. 但是,实际上,收件箱中的项目数可能会频繁更改。However, in reality, the number of items in an Inbox can change frequently. 随时可能收到新邮件,删除或移动项目。New messages can arrive and items can be deleted or moved at any time. 这会对分页有何影响?But how does this impact paging? 我们修改前面的示例场景来找出答案。Let's modify the earlier example scenario to find out.

再从用户收件箱中的 15 个项目开始,然后发送相同的初始请求。We'll start again with the 15 items in the user's Inbox, and send the same initial request. 与前面一样,服务器响应前 10 封邮件,显示该响应不包括最后一个项目,共有 15 个项目,下一个偏移量应为 10,如图 1 所示。As before, the server responds with the first 10 messages, and indicates that the response does not include the last item, that there are a total of 15 items, and that the next offset should be 10, as shown in Figure 1.

现在,当你的应用程序处理这 10 个项目时,收件箱收到了一封新邮件,并将其添加到服务器上的结果集中。Now, while your application is processing those 10 items, a new message arrives in the Inbox and is added to the result set on the server. 应用程序将同一请求重发到服务器(仅使用设置为 10 的偏移量)。Your application resends the same request to the server (only with the offset set to 10). 这一次,服务器将返回六个项目,并显示结果集内共 16 个项目。This time the server gets back six items, and indicates that there are a total of 16 items in the result set.

此时,你可能不确定这是否有问题。At this point you might be wondering if this is even a problem. 毕竟,在两个响应中,你收到了 16 条回复,那么为什么要大惊小怪呢?After all, you got 16 items back over the two responses, so why all the fuss? 答案取决于列表中新项目的放置位置。The answer depends on where in the list the new item is placed. 如果已对列表进行排序,将最先收到的项目(按接收日期/时间)排在前面,在这种情况下不会有任何问题。If the list is sorted so that the oldest items (by received date/time) are first, there's no cause for concern in this scenario. 新项目将位于列表的末尾,包含在第二个响应中。The new item will be placed at the end of the list, and will be included in the second response.

图 3. 从包含 16 个项目的列表开头处开始,以偏移量 10 请求 10 个项目,新项目排在列表第 16 项Figure 3. Requesting 10 items at offset 10 from the beginning of a list of 16 items, with the 16th item in the list being new

此图显示从包含 16 个项目的列表开始,当第 16 个项目添加到列表结束位置时,在偏移量为 10 的情况下,请求 10 个项目的结果。

如果已对列表排序,使最新项目排在首位,会造成不同的结果。If the list is sorted so that the newest items are first, it's a different story. 在这种情况下,第二个请求中的第一个项目是上次请求的最后一个项目加上最初 15 个项目中中剩下的五个。In this case, the first item in the second request would be the last item from the previous request plus the remaining five items from the original 15. 就我们想象中的神奇窗口而言,你将窗口的位置移动了 10 个位置,但广告牌本身也移动了 1 个位置。To put it in terms of our imaginary magical window, you shifted your window's position by 10, but the billboards themselves also shifted by 1.

图 4. 从包含 16 个项目的列表开头处开始,以偏移量 10 请求 10 个项目,新项目排在列表第 1 项Figure 4. Requesting 10 items at offset 10 from the beginning of a list of 16 items, with the first item in the list being new

此图显示从包含 16 个项目的列表开始,当第 16 个项目添加到列表开始位置时,在偏移量为 10 的情况下,请求 10 个项目的结果。

使用定位项的概念可以检测服务器上的结果更改。One way to detect a change to the results on the server is to use the concept of an anchor item. 定位项是你的响应中的一个附加项,与其余的结果不一起处理,而是用于与下一个结果进行比较,以确定项本身是否发生了移位。An anchor item is an additional item in your response that is not processed along with the rest of the results, but is used to compare with the next results to see if the items themselves have shifted. 还是这个简单的示例,如果你的应用程序使用的“窗口”大小为 10,实际上,你设置要返回的最大项目数为 11。Building again on our simple example, if your application is using a "window" size of 10, you actually set the maximum number of items to return to 11. 应用程序照常处理响应中的前 10 个项目。Your application processes the first 10 items in the response as usual. 对于最后一个项目,将项目的标识符保存为一定位标记,然后使用偏移量 10 发出下一个请求。For the last item, you save the item's identifier as an anchor, then issue the next request with an offset of 10. 如果数据未更改,则第二个响应中的第一项应具有与定位标记匹配的项目标识符。If the data has not changed, the first item in the second response should have an item identifier that matches the anchor. 如果项目标识符不匹配,你知道数据已被删除或插入到“分页”的列表部分。If the item identifiers don't match, you know that the data has been removed or inserted in the parts of the list you have already "paged" over.

即使知道数据已更改,仍需决定如何作出反应。Even when you know that the data has changed, you still need to decide how to react. 这个问题也没有一个放之四海而皆准的答案。There isn't a one-size-fits-all answer for this question either. 操作取决于应用程序的特性,以及捕获所有项目的关键程度。Your actions will depend on the nature of your application and how critical it is to capture all items. 你可以完全忽略它,从开始处重新启动进程,或返回跟踪并尝试检测变化发生的位置。You might ignore it altogether, restart the process from the beginning, or back track and try to detect where the change happened.

示例:使用 EWS 托管 API 执行分页搜索Example: Perform a paged search by using the EWS Managed API

以下 EWS 托管 API 方法支持分页:Paging is supported by the following EWS Managed API methods:

如果你使用的是 EWS 托管 API,你的应用程序将使用 ItemViewFolderView 类配置分页,并从服务器上收到有关从 FindItemsResultsFindFoldersResults 类中分页的信息。If you are using the EWS Managed API, your application configures paging with the ItemView or FolderView class and receives information from the server regarding paging from the FindItemsResults or FindFoldersResults class.

下面的示例使用分页搜索检索文件夹中的所有项目,将在每个响应中返回五个项目。The following example retrieves all the items in a folder using a paged search that returns five items in each response. 此外,它还将检索另一个项目,用作定位标记,以检测对服务器上的结果所做的更改。It also retrieves an additional item to serve as an anchor to detect changes to the results on the server.

此示例假定 ExchangeService 对象已使用凭据的有效值和 Url 属性进行了初始化。This example assumes that the ExchangeService object has been initialized with valid values in the Credentials and Url properties.

using Microsoft.Exchange.WebServices.Data;
static void PageSearchItems(ExchangeService service, WellKnownFolderName folder)
{
    int pageSize = 5;
    int offset = 0;
    // Request one more item than your actual pageSize.
    // This will be used to detect a change to the result
    // set while paging.
    ItemView view = new ItemView(pageSize + 1, offset);
    view.PropertySet = new PropertySet(ItemSchema.Subject);
    view.OrderBy.Add(ItemSchema.DateTimeReceived, SortDirection.Descending);
    view.Traversal = ItemTraversal.Shallow;
    bool moreItems = true;
    ItemId anchorId = null;
    while (moreItems)
    {
        try
        {
            FindItemsResults<Item> results = service.FindItems(folder, view);
            moreItems = results.MoreAvailable;
            if (moreItems && anchorId != null)
            {
                // Check the first result to make sure it matches
                // the last result (anchor) from the previous page.
                // If it doesn't, that means that something was added
                // or deleted since you started the search.
                if (results.Items.First<Item>().Id != anchorId)
                {
                    Console.WriteLine("The collection has changed while paging. Some results may be missed.");
                }
            }
            if (moreItems)
                view.Offset += pageSize;
                
            anchorId = results.Items.Last<Item>().Id;
            
            // Because you're including an additional item on the end of your results
            // as an anchor, you don't want to display it.
            // Set the number to loop as the smaller value between
            // the number of items in the collection and the page size.
            int displayCount = 0;
            if ((results.MoreAvailable == false && results.Items.Count > pageSize) || (results.Items.Count < pageSize))
            {
                displayCount = results.Items.Count;
            }
            else
            {
                displayCount = pageSize;
            }
            
            for (int i = 0; i < displayCount; i++)
            {
                Item item = results.Items[i];
                Console.WriteLine("Subject: {0}", item.Subject);
                Console.WriteLine("Id: {0}\n", item.Id.ToString());
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine("Exception while paging results: {0}", ex.Message);
        }
    }
}

示例:使用 EWS 执行分页搜索Example: Perform a paged search by using EWS

以下 EWS 操作支持分页:Paging is supported by the following EWS operations:

如果你使用的是 EWS,你的应用程序将使用 IndexedPageItemView 元素或 IndexedPageFolderView 元素配置分页,并从服务器上接收关从 RootFolder (FindItemResponseMessage) 元素或 RootFolder (FindFolderResponseMessage) 元素分页的信息。If you're using EWS, your application configures paging with the IndexedPageItemView element or the IndexedPageFolderView element and receives information from the server regarding paging from the RootFolder (FindItemResponseMessage) element or the RootFolder (FindFolderResponseMessage) element.

在这个请求示例中,FindItem 请求最多发送六个项目,从用户收件箱中项目列表开头零偏移量开始。In this request example, a FindItem request is sent for a maximum of six items, starting at an offset of zero from the beginning of the list of items in the user's Inbox.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages" 
    xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" 
    xmlns:soap="https://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2007_SP1" />
    <t:TimeZoneContext>
      <t:TimeZoneDefinition Id="Eastern Standard Time" />
    </t:TimeZoneContext>
  </soap:Header>
  <soap:Body>
    <m:FindItem Traversal="Shallow">
      <m:ItemShape>
        <t:BaseShape>IdOnly</t:BaseShape>
        <t:AdditionalProperties>
          <t:FieldURI FieldURI="item:Subject" />
        </t:AdditionalProperties>
      </m:ItemShape>
      <m:IndexedPageItemView MaxEntriesReturned="6" Offset="0" BasePoint="Beginning" />
      <m:ParentFolderIds>
        <t:DistinguishedFolderId Id="inbox" />
      </m:ParentFolderIds>
    </m:FindItem>
  </soap:Body>
</soap:Envelope>

服务器返回以下响应,其中包含六个项目。The server returns the following response, which contains six items. 该响应还表明服务器上的结果中共有八个项目,并且结果列表中的最后一项未出现在此响应中。The response also indicates that there are a total of eight items in the results on the server, and that the last item in the results list is not present in this response.

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="https://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="775" MinorBuildNumber="35" Version="V2_4" 
        xmlns:h="https://schemas.microsoft.com/exchange/services/2006/types" 
        xmlns="https://schemas.microsoft.com/exchange/services/2006/types" 
        xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
  </s:Header>
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <m:FindItemResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages" 
        xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
      <m:ResponseMessages>
        <m:FindItemResponseMessage ResponseClass="Success">
          <m:ResponseCode>NoError</m:ResponseCode>
          <m:RootFolder IndexedPagingOffset="6" TotalItemsInView="8" IncludesLastItemInRange="false">
            <t:Items>
              <t:Message>
                <t:ItemId Id="AAMkAGM2..." ChangeKey="CQAAABYA..." />
                <t:Subject>Query</t:Subject>
              </t:Message>
              <t:Message>
                <t:ItemId Id="AAMkAGM2..." ChangeKey="CQAAABYA..." />
                <t:Subject>Update</t:Subject>
              </t:Message>
              <t:Message>
                <t:ItemId Id="AAMkAGM2..." ChangeKey="CQAAABYA..." />
                <t:Subject>Planning resources</t:Subject>
              </t:Message>
              <t:Message>
                <t:ItemId Id="AAMkAGM2..." ChangeKey="CQAAABYA..." />
                <t:Subject>Timeline</t:Subject>
              </t:Message>
              <t:Message>
                <t:ItemId Id="AAMkAGM2..." ChangeKey="CQAAABYA..." />
                <t:Subject>For your perusal</t:Subject>
              </t:Message>
              <t:Message>
                <t:ItemId Id="AAMkAGM2..." ChangeKey="CQAAABYA..." />
                <t:Subject>meeting notes</t:Subject>
              </t:Message>
            </t:Items>
          </m:RootFolder>
        </m:FindItemResponseMessage>
      </m:ResponseMessages>
    </m:FindItemResponse>
  </s:Body>
</s:Envelope>

在此示例中,发送了同一请求,但这一次, Offset 属性被更改为五,这表示服务器从开始的偏移量五开始,最多可返回六个项目。In this example, the same request is sent, but this time, the Offset attribute is changed to five, which indicates that the server should return at most six items starting at offset five from the beginning.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages" 
    xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" 
    xmlns:soap="https://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2007_SP1" />
    <t:TimeZoneContext>
      <t:TimeZoneDefinition Id="Eastern Standard Time" />
    </t:TimeZoneContext>
  </soap:Header>
  <soap:Body>
    <m:FindItem Traversal="Shallow">
      <m:ItemShape>
        <t:BaseShape>IdOnly</t:BaseShape>
        <t:AdditionalProperties>
          <t:FieldURI FieldURI="item:Subject" />
        </t:AdditionalProperties>
      </m:ItemShape>
      <m:IndexedPageItemView MaxEntriesReturned="6" Offset="5" BasePoint="Beginning" />
      <m:ParentFolderIds>
        <t:DistinguishedFolderId Id="inbox" />
      </m:ParentFolderIds>
    </m:FindItem>
  </soap:Body>
</soap:Envelope>

服务器发送以下响应,其中包含三个项目。The server sends the following response, which contains three items. 该响应还表明服务器上的结果中的项目总数仍为八个,并且结果列表中的最后一项包含在此响应中。The response also indicates that the total number of items in the results on the server is still eight, and that the last item in the results list is included in this response.

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="https://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ServerVersionInfo MajorVersion="15" MinorVersion="0" MajorBuildNumber="775" MinorBuildNumber="35" Version="V2_4" 
        xmlns:h="https://schemas.microsoft.com/exchange/services/2006/types" 
        xmlns="https://schemas.microsoft.com/exchange/services/2006/types" 
        xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />
  </s:Header>
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <m:FindItemResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages" 
    xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
      <m:ResponseMessages>
        <m:FindItemResponseMessage ResponseClass="Success">
          <m:ResponseCode>NoError</m:ResponseCode>
          <m:RootFolder IndexedPagingOffset="8" TotalItemsInView="8" IncludesLastItemInRange="true">
            <t:Items>
              <t:Message>
                <t:ItemId Id="AAMkAGM2..." ChangeKey="CQAAABYA..." />
                <t:Subject>meeting notes</t:Subject>
              </t:Message>
              <t:Message>
                <t:ItemId Id="AAMkAGM2..." ChangeKey="CQAAABYA..." />
                <t:Subject>Meeting notes</t:Subject>
              </t:Message>
              <t:Message>
                <t:ItemId Id="AAMkAGM2..." ChangeKey="CQAAABYA..." />
                <t:Subject>This cat is hilarious!</t:Subject>
              </t:Message>
            </t:Items>
          </m:RootFolder>
        </m:FindItemResponseMessage>
      </m:ResponseMessages>
    </m:FindItemResponse>
  </s:Body>
</s:Envelope>

另请参阅See also