GetSharingMetadata 操作GetSharingMetadata operation

GetSharingMetadata操作获取一个不透明的身份验证令牌,用于标识共享邀请。The GetSharingMetadata operation gets an opaque authentication token that identifies a sharing invitation.

SOAP 标头SOAP Headers

GetSharingMetadata操作可以使用下表中列出和描述的 SOAP 标头。The GetSharingMetadata operation can use the SOAP headers that are listed and described in the following table.

HeaderHeader 元素Element 说明Description
RequestVersionRequestVersion
RequestServerVersionRequestServerVersion
标识操作请求的架构版本。Identifies the schema version for the operation request.
ServerVersionServerVersion
ServerVersionInfoServerVersionInfo
标识响应请求的服务器版本。Identifies the version of the server that responded to the request.

GetSharingMetadata 请求示例GetSharingMetadata request example

DescriptionDescription

下面的示例演示如何形成请求以获取标识共享邀请的不透明身份验证令牌。The following example shows how to form a request to get an opaque authentication token that identifies a sharing invitation. 在此示例中,user1@contoso.com 想要共享由IdOfFolderToShare元素使用 user1@fabikam.com 和 user2@test.com 指定的文件夹。In this example, user1@contoso.com wants to share the folder that is specified by the IdOfFolderToShare element with user1@fabikam.com and user2@test.com.

代码Code

<?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:GetSharingMetadata>
      <m:IdOfFolderToShare Id="AAMkAD=" ChangeKey="AwAAA=" />
      <m:SenderSmtpAddress>user1@contoso.com</m:SenderSmtpAddress>
      <m:Recipients>
        <t:SmtpAddress>user1@fabrikam.com</t:SmtpAddress>
        <t:SmtpAddress>user2@test.com</t:SmtpAddress>
      </m:Recipients>
    </m:GetSharingMetadata>
  </soap:Body>
</soap:Envelope>

备注Comments

收件人(ArrayOfSmtpAddressType)元素包含共享邀请的每个预期收件人的一个SmtpAddress元素。The Recipients (ArrayOfSmtpAddressType) element contains one SmtpAddress element for each intended recipient of the sharing invitation.

成功的 GetSharingMetadata 响应Successful GetSharingMetadata Response

DescriptionDescription

下面的示例演示对GetSharingMetadata请求的成功响应。The following example shows a successful response to a GetSharingMetadata request. 在此示例中,在对应的GetSharingMetadata请求中指定了两个收件人: user1@fabrikam.com 和 user2@test.com。In this example, two recipients were specified in the corresponding GetSharingMetadata request: user1@fabrikam.com and user2@test.com.

代码Code

<?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>
    <GetSharingMetadataResponseMessage 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</ResponseCode>
      <m:EncryptedSharedFolderDataCollection>
        <t:EncryptedSharedFolderData>
          <t:Token>
            <EncryptedData Id="Assertion0" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
              <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"></EncryptionMethod>
              <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                <EncryptedKey>
                  <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p"></EncryptionMethod>
                  <ds:KeyInfo Id="keyinfo">
                    <wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
                      <wsse:KeyIdentifier 
                                  EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" 
                                  ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier">
                        B4VEEAf=
                      </wsse:KeyIdentifier>
                    </wsse:SecurityTokenReference>
                  </ds:KeyInfo>
                  <CipherData>
                    <CipherValue>GI/Dxqvw2na==</CipherValue>
                  </CipherData>
                </EncryptedKey>
              </ds:KeyInfo>
              <CipherData>
                <CipherValue>L77I7Hr06z</CipherValue>
              </CipherData>
            </EncryptedData>
          </t:Token>
          <t:Data>
            <EncryptedData Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns="http://www.w3.org/2001/04/xmlenc#">
              <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc" />
              <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
                <EncryptedKey xmlns="http://www.w3.org/2001/04/xmlenc#">
                  <EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#kw-tripledes" />
                  <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
                    <KeyName>key</KeyName>
                  </KeyInfo>
                  <CipherData>
                    <CipherValue>9UgtjrHiU</CipherValue>
                  </CipherData>
                </EncryptedKey>
              </KeyInfo>
              <CipherData>
                <CipherValue>NCNsJoGtQ==</CipherValue>
              </CipherData>
            </EncryptedData>
          </t:Data>
        </t:EncryptedSharedFolderData>
      </m:EncryptedSharedFolderDataCollection>
      <m:InvalidRecipients>
        <t:InvalidRecipient>
          <t:SmtpAddress>user2@test.com</t:SmtpAddress>
          <t:ResponseCode>RecipientOrganizationNotFederated</t:ResponseCode>
          <m:MessageText>The organization of these recipients is not federated for external sharing.</m:MessageText>
        </t:InvalidRecipient>
      </m:InvalidRecipients>
    </GetSharingMetadataResponseMessage>
  </soap:Body>
</soap:Envelope>

备注Comments

响应包含由GetSharingMetadata请求中指定的有效收件人表示的每个组织的一个EncryptedSharedFolderData元素。The response contains one EncryptedSharedFolderData element for each organization that is represented by valid recipients that are specified in the GetSharingMetadata request.

即使在请求中指定了无效的收件人, GetSharingMetadata请求也将成功。The GetSharingMetadata request will succeed even if invalid recipients are specified in the request. InvalidRecipients元素包含有关无效收件人的信息。The InvalidRecipients element contains information about invalid recipients. 有关收件人可能无效的原因的信息,请参阅ResponseCode (InvalidRecipientResponseCodeType)For information about the reasons why a recipient might be invalid, see ResponseCode (InvalidRecipientResponseCodeType).

如果所有预期收件人都无效,则EncryptedSharedFolderDataCollection元素将为空。If all intended recipients are invalid, the EncryptedSharedFolderDataCollection element will be empty.

GetSharingMetadata 错误响应GetSharingMetadata error response

DescriptionDescription

下面的示例演示对GetSharingMetadata请求的错误响应。The following example shows an error response to a GetSharingMetadata request.

代码Code

<?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>
    <GetSharingMetadataResponseMessage 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>The SMTP address format is invalid.</MessageText>
      <m:ResponseCode>ErrorInvalidSmtpAddress</ResponseCode>
      <m:DescriptiveLinkKey>0</DescriptiveLinkKey>
    </GetSharingMetadataResponseMessage>
  </soap:Body>
</soap:Envelope>

另请参阅See also

GetSharingMetadataGetSharingMetadata

GetSharingMetadataTypeGetSharingMetadataType

GetSharingMetadataResponseMessageGetSharingMetadataResponseMessage

GetSharingMetadataResponseMessageTypeGetSharingMetadataResponseMessageType

Exchange 中的 EWS 操作EWS operations in Exchange