Operação MoveFolderMoveFolder operation

A operação MoveFolder move as pastas de uma pasta especificada e as coloca em outra pasta.The MoveFolder operation moves folders from a specified folder and puts them in another folder.

ComentáriosRemarks

A operação MoveFolder é semelhante à operação CopyFolder.The MoveFolder operation is similar to the CopyFolder operation. Não é possível mover pastas diferenciadas.You cannot move distinguished folders. Você pode mover várias pastas de uma só vez para a pasta de destino.You can move multiple folders at one time to the destination folder.

Exemplo de solicitação MoveFolderMoveFolder request example

DescriçãoDescription

O exemplo a seguir de uma solicitação MoveFolder mostra como formar uma solicitação para mover uma pasta identificada por FolderId e colocar a pasta na pasta diferenciada de lixo eletrônico.The following example of a MoveFolder request shows how to form a request to move a folder identified by the FolderId and put the folder in the Junk E-mail distinguished folder.

CódigoCode

<?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>
    <MoveFolder xmlns="https://schemas.microsoft.com/exchange/services/2006/messages">
      <ToFolderId>
        <t:DistinguishedFolderId Id="junkemail"/>
      </ToFolderId>
      <FolderIds>
        <t:FolderId Id="AScAc"/>
      </FolderIds>
    </MoveFolder>
  </soap:Body>
</soap:Envelope>

ComentáriosComments

Observação

O valor do atributo ID do elemento FolderId foi reduzido para legibilidade.The value of the ID attribute of the FolderId element has been shortened for readability.

Elementos RequestRequest elements

Essa solicitação de MoveFolder inclui os seguintes elementos:This MoveFolder request includes the following elements:

Confira o esquema para elementos adicionais que você pode usar para formar uma solicitação de MoveFolder.See the schema for additional elements that you can use to form a MoveFolder request.

Observação

O local padrão do esquema está no diretório virtual EWS no computador em que a função de servidor de acesso para cliente está instalada.The default location of the schema is in the EWS virtual directory on the computer that has the Client Access server role installed.

Exemplo de resposta MoveFolder bem-sucedidaSuccessful MoveFolder response example

DescriçãoDescription

O exemplo a seguir mostra uma resposta bem-sucedida à solicitação MoveFolder.The following example shows a successful response to the MoveFolder request.

CódigoCode

<?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="685" MinorBuildNumber="8" 
                         xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
  </soap:Header>
  <soap:Body>
    <MoveFolderResponse 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:MoveFolderResponseMessage ResponseClass="Success">
          <m:ResponseCode>NoError</m:ResponseCode>
          <m:Folders>
            <t:Folder>
              <t:FolderId Id="AAAlAFV" ChangeKey="AQAAAB" />
            </t:Folder>
          </m:Folders>
        </m:MoveFolderResponseMessage>
      </m:ResponseMessages>
    </MoveFolderResponse>
  </soap:Body>
</soap:Envelope>

ComentáriosComments

Observação

A ID da pasta e a chave de alteração foram reduzidas para preservar a legibilidade.The folder ID and the change key have been shortened to preserve readability.

O FolderId retornado na resposta representa a pasta que foi movida para o novo local da pasta.The FolderId that is returned in the response represents the folder that was moved to the new the folder location.

Elementos de respostaResponse elements

A resposta MoveFolder inclui os seguintes elementos:The MoveFolder response includes the following elements:

Exemplo de resposta de erro MoveFolderMoveFolder Error response example

DescriçãoDescription

O exemplo a seguir mostra uma resposta de erro que ocorre quando você tenta mover uma pasta distinta.The following example shows an error response that occurs when you try to move a distinguished folder.

CódigoCode

<?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="685" MinorBuildNumber="8" 
                         xmlns:t="https://schemas.microsoft.com/exchange/services/2006/types" />
  </soap:Header>
  <soap:Body>
    <MoveFolderResponse 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:MoveFolderResponseMessage ResponseClass="Error">
          <m:MessageText>Cannot move distinguished folder.</m:MessageText>
          <m:ResponseCode>ErrorMoveDistinguishedFolder</m:ResponseCode>
          <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
          <m:Folders />
        </m:MoveFolderResponseMessage>
      </m:ResponseMessages>
    </MoveFolderResponse>
  </soap:Body>
</soap:Envelope>

Elementos de resposta de erroError response elements

A resposta de erro MoveFolder inclui os seguintes elementos:The MoveFolder error response includes the following elements:

Confira tambémSee also

Operação CopyFolderCopyFolder operation