Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MoveItem xml request is missing namespaces in subelements #129

Open
vlf opened this issue Sep 17, 2020 · 0 comments
Open

MoveItem xml request is missing namespaces in subelements #129

vlf opened this issue Sep 17, 2020 · 0 comments

Comments

@vlf
Copy link

vlf commented Sep 17, 2020

The MoveItem operation is missing crucial namespaces for it to work (at least with Exchange 2013). Fails with "{ "ResponseCode": "ErrorInvalidIdMalformed", "Message": "Id is malformed." }". Using latest release.

<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:tns="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:wsi="http://ws-i.org/schemas/conformanceClaim/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Header>
      <t:RequestServerVersion Version="Exchange2013" />
   </soap:Header>
   <soap:Body>
      <MoveItem xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
         <ToFolderId>
            <FolderId Id="AQMkADB..." ChangeKey="AQAAA..." />
         </ToFolderId>
         <ItemIds>
            <ItemId Id="AQMkAD..." ChangeKey="CQAAA..." />
         </ItemIds>
      </MoveItem>
   </soap:Body>
</soap:Envelope>

Manually adding namespaces to args fixes this:

  const ewsArgs = {
    'tns:ToFolderId': {
      't:FolderId': {
        attributes: {
          Id: folderId,
          ChangeKey: folderChangeKey
        }
      }
    },
    'tns:ItemIds': {
      't:ItemId': {
        attributes: {
          Id: messageId,
          ChangeKey: changeKey
        }
      }
    }
  };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant