Exchange server EWS。FindItem操作。如何将响应数据映射到请求?

Exchange server EWS。FindItem操作。如何将响应数据映射到请求?,exchange-server,exchangewebservices,Exchange Server,Exchangewebservices,在我的应用程序中,我需要查找具有特定自定义属性的消息。我正在使用。这是我请求的XML: <?xml version="1.0" encoding="UTF-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:typ="http

在我的应用程序中,我需要查找具有特定自定义属性的消息。我正在使用。这是我请求的XML:

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mes="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:typ="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
  <typ:RequestServerVersion Version="Exchange2010_SP2" />
</soap:Header>
<soap:Body>
  <mes:FindItem Traversal="Shallow">
     <mes:ItemShape>
        <typ:BaseShape>IdOnly</typ:BaseShape>
     </mes:ItemShape>
     <mes:Restriction>
        <typ:Or>
           <typ:IsEqualTo>
              <typ:ExtendedFieldURI PropertySetId="36603a56-9a21-4e9d-b4b7-6eb13876716a" PropertyName="OriginalId" PropertyType="String" />
              <typ:FieldURIOrConstant>
                 <typ:Constant Value="F33A7D78-5FCB-492E-AE98-D7E1CBB379C7" />
              </typ:FieldURIOrConstant>
           </typ:IsEqualTo>
           <typ:IsEqualTo>
              <typ:ExtendedFieldURI PropertySetId="36603a56-9a21-4e9d-b4b7-6eb13876716a" PropertyName="OriginalId" PropertyType="String" />
              <typ:FieldURIOrConstant>
                 <typ:Constant Value="hello-world-135" />
              </typ:FieldURIOrConstant>
           </typ:IsEqualTo>
           <typ:IsEqualTo>
              <typ:ExtendedFieldURI PropertySetId="36603a56-9a21-4e9d-b4b7-6eb13876716a" PropertyName="OriginalId" PropertyType="String" />
              <typ:FieldURIOrConstant>
                 <typ:Constant Value="9BA188D5-EC35-4E46-AA0B-1C902F6EE70E" />
              </typ:FieldURIOrConstant>
           </typ:IsEqualTo>
        </typ:Or>
     </mes:Restriction>
     <mes:ParentFolderIds>
        <typ:DistinguishedFolderId Id="sentitems" />
     </mes:ParentFolderIds>
  </mes:FindItem>
 </soap:Body>
</soap:Envelope>

我只
因此,我正在寻找三条消息,如您所见。其中一个(第二个)不存在。因此,在响应中,我希望收到一些指示,表明没有找到此特定消息的数据。但这是我在回答中得到的:

<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
  <h:ServerVersionInfo xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" MajorVersion="15" MinorVersion="0" MajorBuildNumber="1365" MinorBuildNumber="1" Version="V2_23" />
</s:Header>
<s:Body xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <m:FindItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
     <m:ResponseMessages>
        <m:FindItemResponseMessage ResponseClass="Success">
           <m:ResponseCode>NoError</m:ResponseCode>
           <m:RootFolder TotalItemsInView="2" IncludesLastItemInRange="true">
              <t:Items>
                 <t:Message>
                    <t:ItemId Id="AAMkADE3MTJkZWNlLTZiYWYtNDY4Yi1hNmM3LWU2MzY2ZDZjYWNhMQBGAAAAAACoXti5FFu8TJNLLS5k9vC8BwAcJDq8WkSCQ77jdOtyazgnAAAAAAEJAAAcJDq8WkSCQ77jdOtyazgnAAEJ1zgKAAA=" ChangeKey="CQAAABYAAAAcJDq8WkSCQ77jdOtyazgnAAEJ7PHv" />
                 </t:Message>
                 <t:Message>
                    <t:ItemId Id="AAMkADE3MTJkZWNlLTZiYWYtNDY4Yi1hNmM3LWU2MzY2ZDZjYWNhMQBGAAAAAACoXti5FFu8TJNLLS5k9vC8BwAcJDq8WkSCQ77jdOtyazgnAAAAAAEJAAAcJDq8WkSCQ77jdOtyazgnAAEJ1zgJAAA=" ChangeKey="CQAAABYAAAAcJDq8WkSCQ77jdOtyazgnAAEJ7PHs" />
                 </t:Message>
              </t:Items>
           </m:RootFolder>
        </m:FindItemResponseMessage>
     </m:ResponseMessages>
  </m:FindItemResponse>
 </s:Body>
</s:Envelope>

无误
只有两条消息,没有指示它们属于请求中的哪些消息。那么,我应该如何将找到的两条消息映射到请求中的数据呢?响应中的消息实际上是1和2吗?2和3?或者1和3(在这种情况下是正确的)?你看到我的困惑了吗?显然我做错了什么。应该有一种方法可以轻松地映射数据。我应该如何以正确的方式构建请求

更新:

我还尝试为每条消息创建一个单独的
FindItem
节点,但不幸的是,这也不起作用。响应只包含第一项的数据,您的元素可以包括可以指定自定义属性的元素,例如“OriginalId”