2016-05-31 6 views
0

Office.context.mailbox.makeEwsRequestAsyncメソッドを使用して、次のXMLクエリをEWSに送信します。 Traversalが "Shallow"に設定されている限り動作します。 Traversalを「Deep」に設定すると、「リクエストが無効です」というエラーが表示されます。 深い検索ができない場合、サブフォルダを再帰的に検索するにはどうすればよいですか?FindItemクエリで深いトラバーサルを行う方法

<?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="Exchange2013_SP1" /> 
    </soap:Header> 
    <soap:Body> 
     <m:FindItem Traversal="Shallow"> 
     <m:ItemShape> 
      <t:BaseShape>AllProperties</t:BaseShape> 
     </m:ItemShape> 
     <m:IndexedPageItemView MaxEntriesReturned="10" Offset="0" BasePoint="Beginning" /> 
     <m:Restriction> 
      <t:Contains ContainmentMode="FullString" ContainmentComparison="IgnoreCase"> 
      <t:FieldURI FieldURI="item:Categories" /> 
      <t:Constant Value="MyCategory" /> 
      </t:Contains> 
     </m:Restriction> 
     <m:ParentFolderIds> 
      <t:DistinguishedFolderId Id="inbox" /> 
      <t:DistinguishedFolderId Id="sentitems" /> 
     </m:ParentFolderIds> 
     </m:FindItem> 
    </soap:Body> 
    </soap:Envelope> 

答えて

1

FindItem EWSコールは、Traversal = "Deep"をサポートしていません。 FindItemを参照してください。

これは、ParentFolderIdsで指定されたフォルダ内の項目を検索するためです。再帰的な検索を行うには、パブリックフォルダではないTraversal = "Deep"をサポートするFindFolder EWS Operationを使用して検索に含めるフォルダのリストを取得する必要があります。追加のドキュメントについては、FindFolderを参照してください。

関連する問題