FindFolder 操作

FindFolder 操作では、Exchange Web Services を使用して識別されたフォルダーのサブフォルダーを検索し、サブフォルダーのセットを記述するプロパティのセットを返します。

FindFolder は、任意のストリーミング可能なプロパティの最初の 512 バイトだけを返します。 Unicode の場合は、Null 終了の Unicode 文字列を使用して最初の 255 文字を返します。

パブリック フォルダーに対してディープ トラバーサル クエリを実行することはできません。

制限は許可されており、アイテム プロパティではなくフォルダー プロパティのみを使用する必要があります。 並べ替え機能は 、FindFolder 応答では使用できません。 グループ化されたクエリは 、FindFolder クエリでは使用できません。

[!注} FindFolder 操作は、マネージド フォルダーの検索にも使用されます。

SOAP ヘッダー

FindFolder 操作では、次の表に記載されている SOAP ヘッダーを使用できます。

Header 要素 説明
偽装 ExchangeImpersonation クライアント アプリケーションが偽装しているユーザーを識別します。
MailboxCulture MailboxCulture メールボックスへのアクセスに使用する RFC3066 カルチャを識別します。
RequestVersion RequestServerVersion 操作要求のスキーマ バージョンを識別します。
ServerVersion ServerVersionInfo 要求に応答したサーバーのバージョンを識別します。
TimeZoneContext TimeZoneContext サーバーからのすべての応答に使用するタイム ゾーンを識別します。

FindFolder 要求の例

次の FindFolder 要求の例は、受信トレイにあるすべてのフォルダーを検索する要求を形成する方法を示しています。

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
  xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Body>
    <FindFolder Traversal="Shallow" xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
      <FolderShape>
        <t:BaseShape>Default</t:BaseShape>
      </FolderShape>
      <ParentFolderIds>
        <t:DistinguishedFolderId Id="inbox"/>
      </ParentFolderIds>
    </FindFolder>
  </soap:Body>
</soap:Envelope>

BaseShape の既定値を使用すると、フォルダー名、フォルダー ID、サブフォルダーの数、フォルダー内で見つかった子フォルダーの数、未読アイテムの数が返されます。

FindFolder 要求要素

この FindFolder 要求には、次の要素が含まれています。

その他の FindFolder 要求要素については、スキーマに関するページを参照してください。

FindFolder 応答の例

次の簡易オブジェクト アクセス プロトコル (SOAP) 本文の例は、 FindFolder 要求に対する正常な応答を示しています。 応答には、 BaseShape の既定値が使用されるときに返される要素が含まれます。

注:

読みやすくするために、フォルダー ID と変更キーが短縮されました。

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
               xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Header>
    <t:ServerVersionInfo MajorVersion="8" MinorVersion="0" MajorBuildNumber="652" MinorBuildNumber="0" 
                         xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
  </soap:Header>
  <soap:Body>
    <FindFolderResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages" 
                        xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" 
                        xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
      <m:ResponseMessages>
        <m:FindFolderResponseMessage ResponseClass="Success">
          <m:ResponseCode>NoError</m:ResponseCode>
          <m:RootFolder TotalItemsInView="1" IncludesLastItemInRange="true">
            <t:Folders>
              <t:Folder>
                <t:FolderId Id="AQAnAH" ChangeKey="AQAAABY" />
                <t:DisplayName>TestFolder</t:DisplayName>
                <t:TotalCount>0</t:TotalCount>
                <t:ChildFolderCount>0</t:ChildFolderCount>
                <t:UnreadCount>0</t:UnreadCount>
              </t:Folder>
            </t:Folders>
          </m:RootFolder>
        </m:FindFolderResponseMessage>
      </m:ResponseMessages>
    </FindFolderResponse>
  </soap:Body>
</soap:Envelope>

FindFolder 応答要素

応答で返されるプロパティは、 BaseShapeAdditionalProperties が使用されている場合に決定されます。 成功した FindFolder 応答には、次の要素が含まれます。

AllProperties 応答図形を持つ要求に対する FindFolder 応答は、パブリック フォルダー検索の TotalCount 要素と UnreadCount 要素を返しません。

FindFolder エラー応答の例

次の SOAP 本文の例は、形式が正しくないフォルダー識別子によって識別されるフォルダーを検索するときに発生するエラー応答を示しています。

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Header>
    <t:ServerVersionInfo MajorVersion="8" MinorVersion="0" MajorBuildNumber="652" MinorBuildNumber="0" 
                         xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
  </soap:Header>
  <soap:Body>
    <FindFolderResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages" 
                          xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" 
                          xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
      <m:ResponseMessages>
        <m:FindFolderResponseMessage ResponseClass="Error">
          <m:MessageText>Id is malformed.</m:MessageText>
          <m:ResponseCode>ErrorInvalidIdMalformed</m:ResponseCode>
          <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
        </m:FindFolderResponseMessage>
      </m:ResponseMessages>
    </FindFolderResponse>
  </soap:Body>
</soap:Envelope>

FindFolder エラー応答要素

FindFolder エラー応答には、次の要素が含まれています。

その他の情報

  • フォルダー DisplayName (string) 要素は、常に既定の図形に含まれます。
  • UnreadCount 要素は、[タスク] フォルダーと [メモ] フォルダーに含まれています。
  • プロパティの種類が Integer の0x672Dの PropertyTag 値を使用して、ExtendedFieldURI 要素を使用してマネージド フォルダーを識別します。

関連項目

フォルダーの検索