UpdateFolder 操作

UpdateFolder 操作は、Exchange ストア内の既存のアイテムのプロパティを変更するために使用されます。 各 UpdateFolder 操作は、次で構成されます。

  • 更新するフォルダーを指定する FolderId 要素。

  • フォルダー図形で指定されたフォルダー内の要素の内部パス。更新するデータを指定します。

  • 更新が削除されていない場合は、更新されたフィールドの新しい値を含むフォルダー。

注釈

アイテムに対して 3 つの基本的な更新アクションを実行できます。 これらのアクションを次の表に示します。

操作 説明
追加
追加アクションは、既存のプロパティにデータを追加します。 現在存在するデータが保持されます。 Append は、すべてのプロパティに適用できるわけではありません。
Set
set アクションは、データが含まれている場合はプロパティのデータを置き換えます。または、 プロパティを作成し、存在しない場合はその値を設定します。 set アクションは、書き込み可能なプロパティにのみ適用されます。
Delete
削除アクションは、フォルダーからプロパティを削除します。 これは、空の値に設定する場合とは異なります。 完了すると、 プロパティはフォルダーに存在しません。 削除は、書き込み可能なプロパティにのみ適用されます。

UpdateFolder 要求の例

説明

次の UpdateFolder 要求の例は、フォルダーの表示名を更新する方法を示しています。

コード

<?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>
    <UpdateFolder xmlns="https://schemas.microsoft.com/exchange/services/2006/messages"
                  xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
      <FolderChanges>
        <t:FolderChange>
          <t:FolderId Id="AScA" ChangeKey="GO3u/"/>
          <t:Updates>
            <t:SetFolderField>
              <t:FieldURI FieldURI="folder:DisplayName"/>
              <t:Folder>
                <t:DisplayName>NewFolderName</t:DisplayName>
              </t:Folder>
            </t:SetFolderField>
          </t:Updates>
        </t:FolderChange>
      </FolderChanges>
    </UpdateFolder>
  </soap:Body>
</soap:Envelope>

Comments

次の使用例は、フォルダーの表示名を NewFolderName に変更します。

注:

FolderId 要素の Id 属性と ChangeKey 属性の値は、読みやすくするために短縮されています。

要求要素

要求では、次の要素が使用されます。

UpdateFolder 要求の形成に使用できる追加の要素については、スキーマを参照してください。

注:

スキーマの既定の場所は、クライアント アクセス サーバーの役割がインストールされているコンピューター上の EWS 仮想ディレクトリにあります。

UpdateFolder 応答の例

説明

次の例は、UpdateFolder 要求に対する正常な応答を示しています。 この例では、フォルダーの更新された状態を反映するために、新しい変更キーが返されます。

コード

<?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="685" MinorBuildNumber="8" 
                         xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
  </soap:Header>
  <soap:Body>
    <UpdateFolderResponse 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:UpdateFolderResponseMessage ResponseClass="Success">
          <m:ResponseCode>NoError</m:ResponseCode>
          <m:Folders>
            <t:Folder>
              <t:FolderId Id="AAAlAFVz" ChangeKey="AQAAAB" />
            </t:Folder>
          </m:Folders>
        </m:UpdateFolderResponseMessage>
      </m:ResponseMessages>
    </UpdateFolderResponse>
  </soap:Body>
</soap:Envelope>

Comments

注:

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

応答で返されるフォルダー ID は、更新されたフォルダーを表します。

成功した応答要素

応答では、次の要素が使用されます。

UpdateFolder エラー応答の例

説明

次の例は、UpdateFolder 要求に対するエラー応答を示しています。

コード

<?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="685" MinorBuildNumber="8" 
                         xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
  </soap:Header>
  <soap:Body>
    <UpdateFolderResponse 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:UpdateFolderResponseMessage ResponseClass="Error">
          <m:MessageText>The change key is invalid.</m:MessageText>
          <m:ResponseCode>ErrorInvalidChangeKey</m:ResponseCode>
          <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
          <m:Folders />
        </m:UpdateFolderResponseMessage>
      </m:ResponseMessages>
    </UpdateFolderResponse>
  </soap:Body>
</soap:Envelope>

Comments

この例では、要求の 無効な ChangeKey 属性が原因で発生するエラー応答を示します。

エラー応答要素

エラー応答では、次の要素が使用されます。

関連項目