Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

4.1 CopyFolder Operation

The following is an example of a CopyFolder operation with the CopyFolderType complex type.

The client constructs the request XML and sends it to the server. The identified folder, along with all contents, is copied to the destination folder, in this example, the Junk E-mail folder. The FolderIdId and ChangeKey attributes 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:m="http://schemas.microsoft.com/exchange/services/2006/messages" 
        xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" 
        xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Header>
      <t:RequestServerVersion Version="Exchange2010" />
    </soap:Header>
    <soap:Body>
      <m:CopyFolder>
        <m:ToFolderId>
          <t:DistinguishedFolderId Id="junkemail" />
        </m:ToFolderId>
        <m:FolderIds>
          <t:FolderId Id="AAMkAGIwODEy" ChangeKey="AQAAABYAAA" />
        </m:FolderIds>
      </m:CopyFolder>
    </soap:Body>
  </soap:Envelope>

The server constructs the response XML and sends it to the client. The FolderId element Id and ChangeKey attributes have been shortened to preserve readability.

  <?xml version="1.0" encoding="utf-8"?>
  <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
      <h:ServerVersionInfo MajorVersion="14" 
          MinorVersion="1" 
          MajorBuildNumber="63" 
          MinorBuildNumber="0" 
          Version="Exchange2010" 
          xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" 
          xmlns="http://schemas.microsoft.com/exchange/services/2006/types" 
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
          xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
    </s:Header>
    <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <m:CopyFolderResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" 
          xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
        <m:ResponseMessages>
          <m:CopyFolderResponseMessage ResponseClass="Success">
            <m:ResponseCode>NoError</m:ResponseCode>
            <m:Folders>
              <t:Folder>
                <t:FolderId Id="AAMkAGIwODEy" ChangeKey="AQAAABYAAA" />
              </t:Folder>
            </m:Folders>
          </m:CopyFolderResponseMessage>
        </m:ResponseMessages>
      </m:CopyFolderResponse>
    </s:Body>
  </s:Envelope>
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.