none
Problem with EWS request UploadItems in Office365/ExchangeOnline: An internal server error occurred. The operation failed., An item with the same key has already been added. RRS feed

  • Question

  • If I download a ContactItem with ExportItems from an Office 365 mailbox and than Upload it by the "Update" operation, I get the following UploadItemsResponseMessage "An internal server error occurred. The operation failed., An item with the same key has already been added."  from the Server.


    Request:

    <?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>
        <RequestServerVersion Version="Exchange2013" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" />
      </soap:Header>
      <soap:Body>
        <UploadItems xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
          <Items>
            <Item CreateAction="Update" xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
              <ParentFolderId Id="AAMk.."  />
              <ItemId Id="AAMk.."/>
              <Data>..AEw4=....</Data>
            </Item>
          </Items>
        </UploadItems>
      </soap:Body>
    </soap:Envelope>

    Response:

    <?xml version="1.0" encoding="utf-8"?>
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
      <s:Header>
        <h:ServerVersionInfo MajorVersion="15" MinorVersion="20" MajorBuildNumber="1792" MinorBuildNumber="19" Version="V2018_01_08"  />
      </s:Header>
      <s:Body>
        <m:UploadItemsResponse >
          <m:ResponseMessages>
            <m:UploadItemsResponseMessage xsi:type="m:UploadItemsResponseMessageType" ResponseClass="Error">
              <m:MessageText>An internal server error occurred. The operation failed., An item with the same key has already been added.</m:MessageText>
              <m:ResponseCode>ErrorInternalServerError</m:ResponseCode>
              <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
            </m:UploadItemsResponseMessage>
          </m:ResponseMessages>
        </m:UploadItemsResponse>
      </s:Body>
    </s:Envelope>

    Does anybody know a solution?

    (I figured that out by using the EWSEditor-function Export Item as Stream and Upload Item as Stream)

    Tuesday, April 16, 2019 12:02 PM

Answers