CopyItem operation
The CopyItem operation copies items and puts the items in a different folder.
CopyItem request example
Description
The following example of a CopyItem request shows how to form a request to copy an item to the Inbox.
Code
<?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>
<CopyItem xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
<ToFolderId>
<t:DistinguishedFolderId Id="inbox"/>
</ToFolderId>
<ItemIds>
<t:ItemId Id="AS4AUnV="/>
</ItemIds>
</CopyItem>
</soap:Body>
</soap:Envelope>
Comments
Note
The folder ID and the change key have been shortened to preserve readability.
Request elements
The following elements are used in the request:
Note
The schema that describes this element is located in the EWS virtual directory of the computer that is running Microsoft Exchange Server 2010 that has the Client Access server role installed.
To find other options for the request message of the CopyItem operation, explore the schema hierarchy. Start at the CopyItem element.
Successful CopyItem Response
Description
The following example shows a successful response to the CopyItem request.
The item identifier of the new item is returned in the response message. Item identifiers are not returned in responses for cross-mailbox or mailbox to public folder CopyItem operations.
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="8" MinorVersion="0" MajorBuildNumber="595" MinorBuildNumber="0"
xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
</soap:Header>
<soap:Body>
<CopyItemResponse 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:CopyItemResponseMessage ResponseClass="Success">
<m:ResponseCode>NoError</m:ResponseCode>
<m:Items>
<t:Message>
<t:ItemID Id="AAMkAd" ChangeKey="FwAAABY" />
</t:Message>
</m:Items>
</m:CopyItemResponseMessage>
</m:ResponseMessages>
</CopyItemResponse>
</soap:Body>
</soap:Envelope>
Successful response elements
The following elements are used in the response:
To find other options for the response message of the CopyItem operation, explore the schema hierarchy. Start at the CopyItemResponse element.
CopyItem error response
Description
The following example shows an error response to a CopyItem 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="8" MinorVersion="0" MajorBuildNumber="595" MinorBuildNumber="0"
xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
</soap:Header>
<soap:Body>
<CopyItemResponse 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:CopyItemResponseMessage ResponseClass="Error">
<m:MessageText>Id is malformed.</m:MessageText>
<m:ResponseCode>ErrorInvalidIdMalformed</m:ResponseCode>
<m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
<m:Items />
</m:CopyItemResponseMessage>
</m:ResponseMessages>
</CopyItemResponse>
</soap:Body>
</soap:Envelope>
Error response elements
The following elements are used in the error response:
To find other options for the error response message of the CopyItem operation, explore the schema hierarchy. Start at the CopyItemResponse element.
See also
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기