ArchiveItem 操作ArchiveItem operation

查找有关ArchiveItem EWS 操作的信息。Find information about the ArchiveItem EWS operation.

ArchiveItem操作将项目移动到邮箱用户的存档邮箱中。The ArchiveItem operation moves an item into the mailbox user's archive mailbox.

Exchange Server 2013 中引入了此操作。This operation was introduced in Exchange Server 2013.

使用 ArchiveItem 操作Using the ArchiveItem operation

ArchiveItem操作在请求中使用两个参数,这些参数标识要移至存档邮箱的项目以及这些项目的目标文件夹。The ArchiveItem operation takes two arguments in the request that identify the items to move to the archive mailbox and the destination folder for those items. 若要使此操作正常运行,必须启用存档邮箱。An archive mailbox must be enabled in order for this operation to work. 有关如何启用存档邮箱的信息,请参阅管理就地存档For information about how to enable an archive mailbox, see Manage In-Place Archives.

ArchiveItem 操作 SOAP 标头ArchiveItem operation SOAP headers

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

标头名称Header name 元素Element 说明Description
模拟Impersonation
ExchangeImpersonationExchangeImpersonation
标识客户端应用程序模拟的用户。Identifies the user whom the client application is impersonating. 此标头适用于请求。This header is applicable to a request.
MailboxCultureMailboxCulture
MailboxCultureMailboxCulture
确定用于访问邮箱的 RFC 3066 中定义的区域性(用于标识语言的标记)。Identifies the culture, as defined in RFC 3066, Tags for the Identification of Languages, to be used to access the mailbox. 此标头适用于请求。This header is applicable to a request.
RequestVersionRequestVersion
RequestServerVersionRequestServerVersion
标识操作请求的架构版本。Identifies the schema version for the operation request. 此标头适用于请求。This header is applicable to a request.
ServerVersionServerVersion
ServerVersionInfoServerVersionInfo
标识响应请求的服务器版本。Identifies the version of the server that responded to the request. 此标头适用于响应。This header is applicable to a response.

ArchiveItem 操作请求示例:将项目移动到存档收件箱文件夹ArchiveItem operation request example: Move an item to the archive inbox folder

以下示例的ArchiveItem操作请求显示如何将项目移动到存档收件箱文件夹。The following example of an ArchiveItem operation request shows how to move an item to the archive Inbox folder.

备注

本文中的所有项目标识符和更改密钥都已缩短,以保持可读性。All item identifiers and change keys in this article have been shortened to preserve readability.

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:xsd="http://www.w3.org/2001/XMLSchema"
               xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
               xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types"
               xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages">
   <soap:Header>
      <t:RequestServerVersion Version="Exchange2013"/>
   </soap:Header>
   <soap:Body>
      <m:ArchiveItem>
         <m:ArchiveSourceFolderId>
            <t:DistinguishedFolderId Id="inbox"/>
         </m:ArchiveSourceFolderId>
         <m:ItemIds>
            <t:ItemId Id="AQMkG5BBwrQAAAxoAAAA=" ChangeKey="CQAAAHCtAAAAAAB7"/>
         </m:ItemIds>
      </m:ArchiveItem>
   </soap:Body>
</soap:Envelope>

请求 SOAP 正文包含以下元素:The request SOAP body contains the following elements:

成功的 ArchiveItem 操作响应Successful ArchiveItem operation response

下面的示例演示对ArchiveItem操作请求的成功响应,以将项目移动到存档邮箱。The following example shows a successful response to an ArchiveItem operation request to move an item to an archive mailbox.

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <h:ServerVersionInfo MajorVersion="15" 
                           MinorVersion="0" 
                           MajorBuildNumber="526" 
                           MinorBuildNumber="0" 
                           Version="Exchange2013" 
                           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:ArchiveItemResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages" 
                             xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
         <m:ResponseMessages>
            <m:ArchiveItemResponseMessage ResponseClass="Success">
               <m:ResponseCode>NoError</m:ResponseCode>
               <m:Items/>
            </m:ArchiveItemResponseMessage>
         </m:ResponseMessages>
      </m:ArchiveItemResponse>
   </s:Body>
</s:Envelope>

响应 SOAP 正文包含以下元素:The response SOAP body contains the following elements:

ArchiveItem 操作错误响应ArchiveItem operation error response

下面的示例演示对ArchiveItem操作请求的错误响应。The following example shows an error response to an ArchiveItem operation request. 这是在未为用户启用存档邮箱的情况中对项目进行存档的有效请求的响应。This is a response to a valid request to archive an item when an archive mailbox is not enabled for a user.

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <h:ServerVersionInfo MajorVersion="15" 
                           MinorVersion="0" 
                           MajorBuildNumber="556" 
                           MinorBuildNumber="8" 
                           Version="Exchange2013" 
                           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:ArchiveItemResponse xmlns:m="https://schemas.microsoft.com/exchange/services/2006/messages" 
                             xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types">
         <m:ResponseMessages>
            <m:ArchiveItemResponseMessage ResponseClass="Error">
               <m:MessageText>Archive mailbox is not enabled for this user.</m:MessageText>
               <m:ResponseCode>ErrorInvalidOperation</m:ResponseCode>
               <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
               <m:Items/>
            </m:ArchiveItemResponseMessage>
         </m:ResponseMessages>
      </m:ArchiveItemResponse>
   </s:Body>
</s:Envelope>

错误响应 SOAP 正文包含以下元素:The error response SOAP body contains the following elements:

有关对 EWS 通用的其他错误代码以及特定于此操作的错误代码,请参阅ResponseCodeFor additional error codes that are generic to EWS and specific to this operation, see ResponseCode.

另请参阅See also