Exchange において EWS を使用して会話を処理する

Exchange で EWS マネージ API または EWS を使用して、会話の検索、会話へのアクションの適用、会話でのアイテムの取得の方法について説明します。

Exchange のコンテキストでは、会話は関連のある一連の電子メール メッセージをグループ化して管理する方法です。 会話は、関連するメッセージを表示する方法も提供できます。 Exchange はスレッドの最初の電子メール メッセージの Message-ID の値に基づいて会話を定義します。 すべての返信および関連するメッセージは、その References ヘッダーおよび In-Reply-To ヘッダーの中で元のメッセージの Message-ID を参照します。

さらに、SOAP エンベロープ内で、メールボックスで受信するメッセージごとに、Exchange は固有のプロパティと要素を設定します。

表 1. すべての電子メール メッセージに設定された会話のプロパティと要素

EWS マネージ API のプロパティ EWS の要素 説明
ConversationTopic
ConversationTopic
元のメッセージに設定された件名の値の正規化されたフォームが含まれています。 これは、Thread-Topic メッセージ ヘッダーと同じです。 この値は読み取り専用です。
ConversationIndex
ConversationIndex
会話内のアイテムの位置を表します。 これは、Thread-Index メッセージ ヘッダーと同じです。 この値は読み取り専用です。

Exchange は同じ ConversationTopic 値を最初のメッセージの返信に適用してから、元のメッセージに対する相対的なメッセージの位置を表す ConversationIndex の値を更新します。 電子メール スレッドの件名が変更になった場合、Exchange は新しい ConversationTopic 値および新しい ConversationIndex 値を新しい会話に適用します。

表 2. 会話を操作するための EWS マネージ API メソッドと EWS 操作

目的 使用する EWS マネージ API メソッド 使用する EWS 操作
会話を検索する
ExchangeService.FindConversation
FindConversation
会話の操作を適用する
Conversation.EnableAlwaysCategorizeItems
Conversation.EnableAlwaysDeleteItems
Conversation.EnableAlwaysMoveItems
ExchangeService.CopyItemsInConversations
ExchangeService.DeleteItemsInConversations
ExchangeService.DisableAlwaysCategorizeItemsInConversations
ExchangeService.DisableAlwaysDeleteItemsInConversations
ExchangeService.DisableAlwaysMoveItemsInConversations
ExchangeService.EnableAlwaysCategorizeItemsInConversations
ExchangeService.EnableAlwaysDeleteItemsInConversations
ExchangeService.EnableAlwaysMoveItemsInConversations
ExchangeService.MoveItemsInConversations
ExchangeService.SetFlagStatusForItemsInConversations
ExchangeService.SetReadStateForItemsInConversations
ExchangeService.SetRetentionPolicyForItemsInConversations
ApplyConversationAction
1 つ以上の会話のアイテムを取得する
ExchangeService.GetConversationItems
GetConversationItems

EWS マネージ API を使用して会話を検索する

次の例に示すように、ExchangeService.FindConversation EWS マネージ API メソッドを使用して、会話を検索することができます。 この例では、受信トレイ フォルダーのうち、件名に「news」という単語を含む最初の 10 個の会話を取得します。 その後、会話のトピック、最後の配信時間、およびグローバルな一意の受信者リストをコンソール ウィンドウに書き込みます。

この例では、service が有効な ExchangeService オブジェクトであり、ユーザーが Exchange サーバーに既に認証されていると想定しています。

static void FindConversation(ExchangeService service)
{
    // Create the view of conversations returned in the response. This view will return at most 10 results.
    ConversationIndexedItemView view = new ConversationIndexedItemView(10);
    // Create the query string to search for.
    String queryString = "subject:news";
    // Search the Inbox for conversations and return a results set with the specified view.
    // This method call results in a FindConversation call to EWS. 
    ICollection<Conversation> conversations = service.FindConversation(view, WellKnownFolderName.Inbox, queryString);
    // Examine properties on each conversation returned in the response.
    foreach (Conversation conversation in conversations)
    {
        Console.WriteLine("Conversation Topic: " + conversation.Topic);
        Console.WriteLine("Last Delivered: " + conversation.LastDeliveryTime.ToString());
        ApplyConversationActions(service, conversation);
        foreach (string GlUniqRec in conversation.GlobalUniqueRecipients)
        {
            Console.WriteLine("Global Unique Recipient: " + GlUniqRec);
        }
        Console.WriteLine("");
    }
}

EWS を使用して会話を検索する

次の例に示すように、FindConversation EWS 操作を使用して、会話を検索することができます。 この例では、受信トレイ フォルダーのうち、件名に「news」という単語を含む最初の 10 個の会話を取得します。 これは、EWS マネージ API を使用して会話を検索する場合に、EWS マネージ API が送信する XML 要求でもあります。

<?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="Exchange2013" />
  </soap:Header>
  <soap:Body>
    <m:FindConversation>
      <m:IndexedPageItemView MaxEntriesReturned="10"
                             Offset="0"
                             BasePoint="Beginning" />
      <m:ParentFolderId>
        <t:DistinguishedFolderId Id="inbox" />
      </m:ParentFolderId>
      <m:QueryString>subject:news</m:QueryString>
    </m:FindConversation>
  </soap:Body>
</soap:Envelope>

サーバーは、FindConversation 要求に対して FindConversationResponse メッセージで応答します。このメッセージには、ResponseCode の値として NoError が含まれており、それは、操作が正常に完了したことを示しています。 また、この応答には、「news」という単語を含む件名が入っているメールボックス内の会話が 1 つだけ含まれています。

ItemIdChangeKey、および ConversationId の属性は読みやすいよう短縮されています。

<?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="883"
                         MinorBuildNumber="10"
                         Version="V2_10"
                         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">
    <FindConversationResponse ResponseClass="Success"
                              xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
      <ResponseCode>NoError</ResponseCode>
      <Conversations>
        <Conversation xmlns="https://schemas.microsoft.com/exchange/services/2006/types">
          <ConversationId Id="aO2NM+Q=" />
          <ConversationTopic>Today's top news headlines</ConversationTopic>
          <UniqueRecipients>
            <String>Sadie Daniels</String>
          </UniqueRecipients>
          <GlobalUniqueRecipients>
            <String>Sadie Daniels</String>
          </GlobalUniqueRecipients>
          <UniqueUnreadSenders>
            <String>Ronnie Sturgis</String>
          </UniqueUnreadSenders>
          <GlobalUniqueUnreadSenders>
            <String>Ronnie Sturgis</String>
          </GlobalUniqueUnreadSenders>
          <UniqueSenders>
            <String>Ronnie Sturgis</String>
          </UniqueSenders>
          <GlobalUniqueSenders>
            <String>Ronnie Sturgis</String>
          </GlobalUniqueSenders>
          <LastDeliveryTime>2014-02-18T20:42:26Z</LastDeliveryTime>
          <GlobalLastDeliveryTime>2014-02-18T20:42:26Z</GlobalLastDeliveryTime>
          <HasAttachments>false</HasAttachments>
          <GlobalHasAttachments>false</GlobalHasAttachments>
          <MessageCount>1</MessageCount>
          <GlobalMessageCount>1</GlobalMessageCount>
          <UnreadCount>1</UnreadCount>
          <GlobalUnreadCount>1</GlobalUnreadCount>
          <Size>9330</Size>
          <GlobalSize>9330</GlobalSize>
          <ItemClasses>
            <ItemClass>IPM.Note</ItemClass>
          </ItemClasses>
          <GlobalItemClasses>
            <ItemClass>IPM.Note</ItemClass>
          </GlobalItemClasses>
          <Importance>Normal</Importance>
          <GlobalImportance>Normal</GlobalImportance>
          <ItemIds>
            <ItemId Id="sVCyAAA="
                    ChangeKey="CQAAAA==" />
          </ItemIds>
          <GlobalItemIds>
            <ItemId Id="sVCyAAA="
                    ChangeKey="CQAAAA==" />
          </GlobalItemIds>
          <LastModifiedTime>2014-02-18T20:42:26Z</LastModifiedTime>
          <InstanceKey>AQAAAAAAAQABAAAACbFYggAAAAA=</InstanceKey>
          <HasIrm>false</HasIrm>
          <GlobalHasIrm>false</GlobalHasIrm>
        </Conversation>
      </Conversations>
      <TotalConversationsInView>1</TotalConversationsInView>
      <IndexedOffset>1</IndexedOffset>
    </FindConversationResponse>
  </s:Body>
</s:Envelope>

EWS マネージ API を使用して会話の操作を適用する

次の例に示すように、いくつかの EWS マネージ API メソッドを使用して、会話の操作を会話に適用できます。 この例では、会話の既存のアイテムにカテゴリを追加し、会話の将来のアイテムに同じカテゴリを適用します。 また、フォルダーへの会話のアイテムの自動移動を有効にする方法も示します。 この例では、アイテムが [下書き] フォルダーに移動されます。

この例では、service が有効な ExchangeService オブジェクトであり、ユーザーが Exchange サーバーに既に認証されていると想定しています。

会話の操作を適用するメソッドの完全な一覧については、表 2 を参照してください。

static void ApplyConversationActions(ExchangeService service, Conversation conversation)
{
   // Create a list of categories to apply to a conversation.
   List<string> categories = new List<string>();
   categories.Add("Customer");
   categories.Add("System Integrator");
   // Apply categorization to all items in the conversation and process the request
   // synchronously after enabling this rule and after all item categorization has been applied. 
   // This method call results in an ApplyConversationAction call to EWS.
   conversation.EnableAlwaysCategorizeItems(categories, true);
   // Apply an always move rule to all items in the conversation and move the items
   // to the Drafts folder. Process the request asynchronously and return the response. 
   // immediately. This method call results in an ApplyConversationAction call to EWS.
   conversation.EnableAlwaysMoveItems(WellKnownFolderName.Drafts, false);
}

EWS を使用して会話の操作を適用する

次の例に示すように、ApplyConversationAction 操作を使用して、カテゴリ化、削除、移動などの会話の操作を適用できます。 この例では、会話の既存のアイテムにカテゴリを追加し、会話の将来のアイテムに同じカテゴリを適用します。 また、フォルダーへの会話のアイテムの自動移動を有効にする方法も示します。この例では、アイテムは [下書き] フォルダーに移動されます。 これは、EWS マネージ API を使用して会話の操作を適用する場合に、EWS マネージ API が送信する XML 要求でもあります。

ConversationId 要素の値は読みやすいよう短縮されています。

<?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="Exchange2013" />
  </soap:Header>
  <soap:Body>
    <m:ApplyConversationAction>
      <m:ConversationActions>
        <t:ConversationAction>
          <t:Action>AlwaysMove</t:Action>
          <t:ConversationId Id="jG6WVpg=" />
          <t:ProcessRightAway>false</t:ProcessRightAway>
          <t:DestinationFolderId>
            <t:DistinguishedFolderId Id="drafts" />
          </t:DestinationFolderId>
        </t:ConversationAction>
      </m:ConversationActions>
    </m:ApplyConversationAction>
  </soap:Body>
</soap:Envelope>

サーバーは、ApplyConversationActionResponse メッセージで ApplyConversationAction 要求に応答します。このメッセージには、操作が正常に完了したことを示す、NoErrorResponseCode の値が含まれます。

EWS マネージ API の会話 ID を使用して 1 つの会話のアイテムを取得する

ExchangeService.GetConversationItems EWS マネージ API メソッドを使用して、会話内のアイテムを取得できます。 次の使用例では、受信トレイ内の最初の会話の会話ノードのセットを提供します。 各アイテムのアイテム識別子、件名、受信時刻が応答で返されるほかに、会話インデックスと親の会話のインデックス プロパティも返されます。 会話インデックス プロパティを使用すると、ノードの階層構造を再構築できます。

この例では、既定の [削除済みアイテム] および [下書き] フォルダー内のすべての会話のアイテムは無視します。

この例では、service が有効な ExchangeService オブジェクトであり、ユーザーが Exchange サーバーに既に認証されていると想定しています。

static void GetConversationItemsSingleConversation(ExchangeService service)
{
   try
   {
      // Find the first item in the mailbox.
      // This method call results in an FindItem call to EWS.
      FindItemsResults<Item> results = service.FindItems(WellKnownFolderName.Inbox,
                                                         new ItemView(1));
      // Get the conversation identifier of the item. 
      ConversationId convId = results.Items[0].ConversationId;
      // Specify the properties that will be 
      // returned for the items in the conversation.
      PropertySet properties = new PropertySet(BasePropertySet.IdOnly,
                                                ItemSchema.Subject,
                                                ItemSchema.DateTimeReceived);
      // Identify the folders to ignore.
      Collection<FolderId> foldersToIgnore = new Collection<FolderId>() 
          { WellKnownFolderName.DeletedItems, WellKnownFolderName.Drafts };
      // Request the conversation items.
      // This method call results in an GetConversationItems call to EWS.
      ConversationResponse response = service.GetConversationItems(convId,
                                                   properties,
                                                  null,
                                                  foldersToIgnore,
                                                  ConversationSortOrder.TreeOrderDescending);
      // Get the synchronization state of the conversation.
      Console.WriteLine("SyncState: " + response.SyncState);
      Collection<Item> items = new Collection<Item>();
      // Process each node of conversation items.
      foreach (ConversationNode node in response.ConversationNodes)
      {
         Console.WriteLine("Parent conversation index: " + node.ParentConversationIndex);
         Console.WriteLine("Conversation index: " + node.ConversationIndex);
         Console.WriteLine("Conversation node items:");
         // Process each item in the conversation node.
         foreach (Item item in node.Items)
         {
            Console.WriteLine("   Item ID: " + item.Id.UniqueId);
            Console.WriteLine("   Subject: " + item.Subject);
            Console.WriteLine("   Received: " + item.DateTimeReceived);
            items.Add(item);
         }
      }
   }
   // This exception occurs if there is an error with the service.
   catch (ServiceResponseException srException)
   {
      Console.WriteLine(srException);
   }
}

会話のアイテムを取得する後続の要求のために、SyncState プロパティをキャッシュすることをお勧めします。

EWS マネージ API の ConversationRequest オブジェクトを使用して多数の会話のアイテムを取得する

ConversationRequest オブジェクトと ExchangeService.GetConversationItems EWS マネージ API メソッドを使用して、2 つ以上の会話からアイテムを取得できます。 次の例では、受信トレイ内の最初の 2 つの会話の会話ノードのセットを提供します。 各アイテムのアイテム識別子、件名、受信時刻が応答で返されるほかに、会話インデックスと親の会話のインデックス プロパティも返されます。 会話インデックス プロパティを使用すると、ノードの階層構造を再構築できます。 次の使用例は、受信トレイの最初の 2 つのアイテムが別の会話からであると想定しています。

この例では、既定の [削除済みアイテム] および [下書き] フォルダー内のすべての会話のアイテムは無視します。

この例では、service が有効な ExchangeService オブジェクトであり、ユーザーが Exchange サーバーに既に認証されていると想定しています。

static void GetConversationItemsManyConversations(ExchangeService service)
{
   try
   {
      // Find the first two items in the Inbox. This item will be used to call the GetConversationItems operation.
      // This method call results in an FindItem call to EWS.
      FindItemsResults<Item> results = service.FindItems(WellKnownFolderName.Inbox, new ItemView(2));
      // Get the conversation identifier of the first two items in the Inbox. 
      ConversationId convId1 = results.Items[0].ConversationId;
      ConversationId convId2 = results.Items[1].ConversationId;
      
      // Identify two conversation requests. 
      ConversationRequest convR1 = new ConversationRequest();
      convR1.ConversationId = convId1;
      ConversationRequest convR2 = new ConversationRequest();
      convR2.ConversationId = convId2;
      // Create a collection of conversations to fetch. 
      Collection<ConversationRequest> conversations = new Collection<ConversationRequest>();
      conversations.Add(convR1);
      conversations.Add(convR2);
      // Specify the properties that will be returned for the items in the conversation.
      PropertySet properties = new PropertySet(BasePropertySet.IdOnly,
                                                ItemSchema.Subject,
                                                ItemSchema.DateTimeReceived);
      // Identify the folders to ignore.
      Collection<FolderId> foldersToIgnore = new Collection<FolderId>() 
          { WellKnownFolderName.DeletedItems, WellKnownFolderName.Drafts };
      // Request the conversation items.
      // This method call results in an GetConversationItems call to EWS.
      ServiceResponseCollection<GetConversationItemsResponse> responses = 
          service.GetConversationItems(conversations, properties, foldersToIgnore, 
          ConversationSortOrder.TreeOrderDescending);
      // Process each conversation.
      foreach (GetConversationItemsResponse resp in responses)
      {
         // Identify the synchronization state of the conversation.
         Console.WriteLine("Sync State: " + resp.Conversation.SyncState);
         // Process each node in the conversation.
         foreach (ConversationNode node in resp.Conversation.ConversationNodes)
         {
            Console.WriteLine("Parent conversation index: " + node.ParentConversationIndex);
            Console.WriteLine("Conversation index: " + node.ConversationIndex);
            Console.WriteLine("Conversation node items:");
            // Process each item in the conversation node.
            foreach (Item item in node.Items)
            {
               Console.WriteLine("   Item ID: " + item.Id.UniqueId);
               Console.WriteLine("   Subject: " + item.Subject);
               Console.WriteLine("   Received: " + item.DateTimeReceived);
            }
         }
      }
   }
   // This exception occurs if there is an error with the service.
   catch (ServiceResponseException srException)
   { 
      Console.WriteLine(srException);
   }
}

ベスト プラクティスとして、BasePropertySet クラスに FirstClassProperties オプションを使用するのではなく、クライアント アプリケーションに必要なプロパティだけを返すことをお勧めします。 会話のアイテムを取得する後続の要求のために、SyncState プロパティをキャッシュすることをお勧めします。

EWS の会話 ID を使用して会話のアイテムを取得する

GetConversationItems EWS 操作を使用して、会話内のアイテムを取得できます。 次の使用例では、受信トレイ内の最初の会話の会話ノードのセットを提供します。 各アイテムのアイテム識別子、件名、受信時刻が応答で返されるほかに、会話インデックスと親の会話のインデックス プロパティも返されます。 会話インデックス プロパティを使用すると、ノードの階層構造を再構築できます。

この例では、既定の [削除済みアイテム] および [下書き] フォルダー内のすべての会話のアイテムは無視します。

ConversationId 要素の値は読みやすいよう短縮されています。

複数の会話からアイテムを取得するには、追加の Conversation 要素を含めます。

<?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="Exchange2013" />
  </soap:Header>
  <soap:Body>
    <m:GetConversationItems>
      <m:ItemShape>
        <t:BaseShape>IdOnly</t:BaseShape>
        <t:AdditionalProperties>
          <t:FieldURI FieldURI="item:Subject" />
          <t:FieldURI FieldURI="item:DateTimeReceived" />
        </t:AdditionalProperties>
      </m:ItemShape>
      <m:FoldersToIgnore>
        <t:DistinguishedFolderId Id="deleteditems" />
        <t:DistinguishedFolderId Id="drafts" />
      </m:FoldersToIgnore>
      <m:SortOrder>TreeOrderDescending</m:SortOrder>
      <m:Conversations>
        <t:Conversation>
          <t:ConversationId Id="LUQFH6Q=" />
        </t:Conversation>
      </m:Conversations>
    </m:GetConversationItems>
  </soap:Body>
</soap:Envelope>

サーバーは、GetConversationItems 要求に対して GetConversationItemsResponse メッセージで応答します。このメッセージには、ResponseCode の値として NoError が含まれおり、それは、操作が正常に完了したことを示しています。 応答は、会話の ConversationNodes にも含まれています。

ItemIdSyncState、および ConversationId の属性は読みやすいよう短縮されています。

<s:Envelope xmlns:s="https://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ServerVersionInfo MajorVersion="15"
                         MinorVersion="0"
                         MajorBuildNumber="873"
                         MinorBuildNumber="9"
                         Version="V2_9"
                         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:GetConversationItemsResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages"
                                    xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
      <m:ResponseMessages>
        <m:GetConversationItemsResponseMessage ResponseClass="Success">
          <m:ResponseCode>NoError</m:ResponseCode>
          <m:Conversation>
            <t:ConversationId Id="LUQFH6Q=" />
            <t:SyncState>AAAAYAm1</t:SyncState>
            <t:ConversationNodes>
              <t:ConversationNode>
                <t:InternetMessageId>&amp;lt;994051d7c1a346efbfce8dec2cbad509
                    @SN2SR01MB006.com&amp;gt;</t:InternetMessageId>
                <t:ParentInternetMessageId>&amp;lt;faa2b1df30074380abe3527b0cd18ca5
                    @SN2SR01MB001.com&amp;gt;</t:ParentInternetMessageId>
                <t:Items>
                  <t:Message>
                    <t:ItemId Id="AYB1NAAA="
                              ChangeKey="CQAAABYAAAD/oydcA+SPQZGbKWNyvNIZAAAAYCHq" />
                    <t:Subject>RE: Review Proposal for Tailspin Toys</t:Subject>
                    <t:DateTimeReceived>2014-01-02T13:15:00Z</t:DateTimeReceived>
                  </t:Message>
                </t:Items>
              </t:ConversationNode>
              <t:ConversationNode>
                <t:InternetMessageId>&amp;lt;faa2b1df30074380abe3527b0cd18ca5
                    @SN2SR01MB001.com&amp;gt;</t:InternetMessageId>
                <t:ParentInternetMessageId>&amp;lt;6a8e7658524b41cda7cdc3f23c1074a5
                    @SN2SR01MB001.com&amp;gt;</t:ParentInternetMessageId>
                <t:Items>
                  <t:Message>
                    <t:ItemId Id="lQAAAA=="
                              ChangeKey="CQAAABYAAAD/oydcA+SPQZGbKWNyvNIZAAAAYAu8" />
                    <t:Subject>RE: Review Proposal for Tailspin Toys</t:Subject>
                    <t:DateTimeReceived>2014-01-02T10:02:08Z</t:DateTimeReceived>
                  </t:Message>
                </t:Items>
              </t:ConversationNode>
              <t:ConversationNode>
                <t:InternetMessageId>&amp;lt;bcdb185495834370a874a1e7ebedbb96
                    @SN2SR01MB005.com&amp;gt;</t:InternetMessageId>
                <t:ParentInternetMessageId>&amp;lt;e52a4de6b98d484887e141da094a2ce6
                    @SN2SR01MB006.com&amp;gt;</t:ParentInternetMessageId>
                <t:Items>
                  <t:Message>
                    <t:ItemId Id="igAAAA=="
                              ChangeKey="CQAAABYAAAD/oydcA+SPQZGbKWNyvNIZAAAAYAuj" />
                    <t:Subject>RE: Review Proposal for Tailspin Toys</t:Subject>
                    <t:DateTimeReceived>2014-01-02T16:20:10Z</t:DateTimeReceived>
                  </t:Message>
                </t:Items>
              </t:ConversationNode>
              <t:ConversationNode>
                <t:InternetMessageId>&amp;lt;e52a4de6b98d484887e141da094a2ce6
                    @SN2SR01MB006.com&amp;gt;</t:InternetMessageId>
                <t:ParentInternetMessageId>&amp;lt;f0db3ead01db4fe087d98022149aa16f
                    @SN2SR01MB001.com&amp;gt;</t:ParentInternetMessageId>
                <t:Items>
                  <t:Message>
                    <t:ItemId Id="iwAAAA=="
                              ChangeKey="CQAAABYAAAD/oydcA+SPQZGbKWNyvNIZAAAAYAul" />
                    <t:Subject>RE: Review Proposal for Tailspin Toys</t:Subject>
                    <t:DateTimeReceived>2014-01-02T15:30:10Z</t:DateTimeReceived>
                  </t:Message>
                </t:Items>
              </t:ConversationNode>
              <t:ConversationNode>
                <t:InternetMessageId>&amp;lt;f0db3ead01db4fe087d98022149aa16f
                    @SN2SR01MB001.com&amp;gt;</t:InternetMessageId>
                <t:ParentInternetMessageId>&amp;lt;88b1884ecaaa4f68b081c009d827e8c6
                    @SN2SR01MB003.com&amp;gt;</t:ParentInternetMessageId>
                <t:Items>
                  <t:Message>
                    <t:ItemId Id="jQAAAA=="
                              ChangeKey="CQAAABYAAAD/oydcA+SPQZGbKWNyvNIZAAAAYAuq" />
                    <t:Subject>RE: Review Proposal for Tailspin Toys</t:Subject>
                    <t:DateTimeReceived>2014-01-02T14:20:10Z</t:DateTimeReceived>
                  </t:Message>
                </t:Items>
              </t:ConversationNode>
              <t:ConversationNode>
                <t:InternetMessageId>&amp;lt;88b1884ecaaa4f68b081c009d827e8c6
                    @SN2SR01MB003.com&amp;gt;</t:InternetMessageId>
                <t:ParentInternetMessageId>&amp;lt;faa2b1df30074380abe3527b0cd18ca5
                    @SN2SR01MB001.com&amp;gt;</t:ParentInternetMessageId>
                <t:Items>
                  <t:Message>
                    <t:ItemId Id="kAAAAA=="
                              ChangeKey="CQAAABYAAAD/oydcA+SPQZGbKWNyvNIZAAAAYAux" />
                    <t:Subject>RE: Review Proposal for Tailspin Toys</t:Subject>
                    <t:DateTimeReceived>2014-01-02T12:52:09Z</t:DateTimeReceived>
                  </t:Message>
                </t:Items>
              </t:ConversationNode>
            </t:ConversationNodes>
          </m:Conversation>
        </m:GetConversationItemsResponseMessage>
      </m:ResponseMessages>
    </m:GetConversationItemsResponse>
  </s:Body>
</s:Envelope>

バージョンの相違点

Exchange Server 2010 Service Pack 1 (SP1) を使用している場合、FindConversation メソッドは利用できるオプションが少なく、FindConversation 操作は要求の要素が少なくなります。

表 3. Exchange 2010 SP1 バージョンの FindConversation のサポート

EWS マネージ API メソッド EWS 要素
FindConversation (ViewBase、FolderId)
IndexedPageItemView
SortOrder
ParentFolderId

GetConversationItems EWS マネージ API メソッド、および GetConversationItems EWS 操作は、Exchange Server 2013 で導入されました。 Exchange の以前のバージョンを対象とするアプリケーションは、表 2 に示すように、会話の操作のみを会話に適用できます。

FindConversation EWS マネージ API メソッド、および FindConversation EWS メソッドは、Exchange 2010 または Exchange 2007 の最初のリリース バージョンでは利用できません。

関連項目