GetSharingFolder 操作

GetSharingFolder 操作は、指定された共有フォルダーのローカル フォルダー識別子を取得します。

SOAP ヘッダー

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

Header 要素 説明
RequestVersion
RequestServerVersion
操作要求のスキーマ バージョンを識別します。
ServerVersion
ServerVersionInfo
要求に応答したサーバーのバージョンを識別します。

GetSharingFolder 要求の例

共有するフォルダーの SharedFolderId 要素を指定してローカル フォルダー識別子を取得する

次のコード例は、共有されているフォルダーに対応するローカル フォルダーの識別子を取得する要求を形成する方法を示しています。 共有されているフォルダーは、共有されているフォルダーを含むメールボックスの SMTP アドレスと、そのフォルダーの識別子を表す SharedFolderId 要素によって識別されます。 この例では、共有されているフォルダーは によって user1@contoso.com所有されています。

コード

<?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"
               xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages"
               xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2010"/>
  </soap:Header>
  <soap:Body>
    <m:GetSharingFolder>
      <m:SmtpAddress>user1@contoso.com</m:SmtpAddress>
      <m:SharedFolderId>AAMkA=</m:SharedFolderId>
    </m:GetSharingFolder>
  </soap:Body>
</soap:Envelope>

共有するフォルダーの DataType 要素を指定してローカル フォルダー識別子を取得する

次のコード例は、共有されているフォルダーに対応するローカル フォルダーの識別子を取得する要求を形成する方法を示しています。 共有されているフォルダーは、共有されているフォルダーを含むメールボックスの SMTP アドレスと、そのフォルダー内のデータの種類を表す DataType 要素によって識別されます。 この例では、共有されているフォルダーは、 によって user1@contoso.com所有されている連絡先フォルダーです。

コード

<?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"
               xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages"
               xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2010"/>
  </soap:Header>
  <soap:Body>
    <m:GetSharingFolder>
      <m:SmtpAddress>user1@contoso.com</m:SmtpAddress>
      <m:DataType>Contacts</m:DataType>
    </m:GetSharingFolder>
  </soap:Body>
</soap:Envelope>

Comments

DataType 要素の使用可能な値の詳細については、「DataType」を参照してください。

GetSharingFolder 応答の成功

説明

次の例は、 GetSharingFolder 要求に対する正常な応答を示しています。 SharingFolderId 要素の 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="14" 
                         MinorVersion="0" 
                         MajorBuildNumber="639" 
                         MinorBuildNumber="11" 
                         Version="Exchange2010" 
                         xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
  </soap:Header>
  <soap:Body>
    <GetSharingFolderResponseMessage ResponseClass="Success"
                                xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types"
                                xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages"
                                xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
      <m:ResponseCode>NoError</m:ResponseCode>
      <m:SharingFolderId Id="AAMkAD=" ChangeKey="AwAAA=" />
    </GetSharingFolderResponseMessage>
  </soap:Body>
</soap:Envelope>

GetSharingFolder エラー応答

説明

次の例は、 GetSharingFolder 要求に対するエラー応答を示しています。 この例では、要求で SharingFolderId 要素と DataType 要素の両方が指定されたため、エラーが発生しました。 指定できるのは、これら 2 つの要素のうちの 1 つのみですが、両方を指定することはできません。

コード

<?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="14" 
                         MinorVersion="0" 
                         MajorBuildNumber="639" 
                         MinorBuildNumber="11" 
                         Version="Exchange2010" 
                         xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
  </soap:Header>
  <soap:Body>
    <GetSharingFolderResponseMessage ResponseClass="Error" 
                                xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types"
                                xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages"
                                xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
      <m:MessageText>Either DataType or SharedFolderId must be specified, but not both.</m:MessageText>
      <m:ResponseCode>ErrorInvalidGetSharingFolderRequest</m:ResponseCode>
      <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
    </GetSharingFolderResponseMessage>
  </soap:Body>
</soap:Envelope>

関連項目

GetSharingFolder

GetSharingFolderType

GetSharingFolderResponseMessage

GetSharingFolderResponseMessageType

Exchange での EWS 操作