CreateAttachment clears ContentId of other attachments RRS feed

  • Question

  • Hi everybody

    I'm experiencing a strange problem. I have an exchange 2010 server and I want to synchronize the attachments by EWS. Getting the attachments works just like it should. But when I create a new Attachment for a calendar item that already has some attachments, the content id of those will be cleared.

    For example the calendar item has two attachments:

    attachment1.png, content id = cid1

    attachment2.png, content id = cid2

    To create a new attachment, I send following XML to EWS:

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
          <ns2:RequestServerVersion xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/types"
          <TimeZoneContext xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
             <TimeZoneDefinition Id="W. Europe Standard Time"/>
          <ns2:CreateAttachment xmlns:ns2="http://schemas.microsoft.com/exchange/services/2006/messages"
             <ns2:ParentItemId ChangeKey="DwAAABYAAACbw/kj8+wZQb5RgDZk9KfaAAAm+u79"
                   <ns3:Content>[some base64 encoded content]</ns3:Content>

    The response of this request tells me that everything went fine and it gives me the attachment id for this attachment. But unfortunately the content id of all the other attachments have been cleared:

    attachment1.png, content id = ""

    attachment2.png, content id = ""

    attachment3.png, content id = cid3

    What am I doing wrong? Do I need to recreate every attachment when creating a new one? Or is it just a bug of exchange 2010?

    Thank you for your help!

    Friday, December 23, 2016 11:03 AM