OfficeDev / ews-managed-api

Other
585 stars 319 forks source link

Fail to create item to office 365 #153

Open joewutaiwan opened 6 years ago

joewutaiwan commented 6 years ago

Hi all,

The problem is when I create a downloaded eml from server, and it returns an error

ErrorObjectTypeChanged

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <h:ServerVersionInfo xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" MajorVersion="15" MinorVersion="20" MajorBuildNumber="464" MinorBuildNumber="16" Version="V2018_01_08"/>
  </s:Header>
  <s:Body>
    <m:CreateItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
      <m:ResponseMessages>
        <m:CreateItemResponseMessage ResponseClass="Error">
          <m:MessageText>Operation would change object type, which is not permitted.</m:MessageText>
          <m:ResponseCode>ErrorObjectTypeChanged</m:ResponseCode>
          <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
          <m:Items/>
        </m:CreateItemResponseMessage>
      </m:ResponseMessages>
    </m:CreateItemResponse>
  </s:Body>
</s:Envelope>

But some MeetingRequest type messages could make this, so how should handle this?

Thanks!

davster commented 6 years ago

Can you post what your request looks like?

joewutaiwan commented 6 years ago

@davster ,

Yes,

<?xml version="1.0"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">
  <soap:Header>
    <t:RequestServerVersion Version="Exchange2013"/>
    <t:ExchangeImpersonation>
      <t:ConnectingSID>
        <t:PrincipalName>jackiel@synologydst.onmicrosoft.com</t:PrincipalName>
      </t:ConnectingSID>
    </t:ExchangeImpersonation>
  </soap:Header>
  <soap:Body>
    <m:CreateItem MessageDisposition="SaveOnly">
      <m:SavedItemFolderId>
        <t:FolderId Id="AAMkAGU4MjE3NDA5LTNmMmMtNDUwYi1iMjk5LTFlNTkzOTE0YTk0NAAuAAAAAADK5iiXu3goQLndw7y+3oX3AQB8LtF36uebRYxyeM34OJD1AAEJ+wNjAAA="/>
      </m:SavedItemFolderId>
      <m:Items>
        <t:Message>
          <t:MimeContent CharacterSet="UTF-8">UmVjZWl2ZWQ6IGZyb20gS0wxUFIwNk1CMTA5My5hcGNwcmQwNi5wcm9kLm91dGxvb2suY29tICgyNjAzOjEwOTY6MjAyOjE0OjozMykNCiBieSBISzJQUjA2TUIwNDUyLmFwY3ByZDA2LnByb2Qub3V0bG9vay5jb20gd2l0aCBIVFRQUyB2aWENCiBISzJQUjA0Q0EwMDY1LkFQQ1BSRDA0LlBST0QuT1VUTE9PSy5DT007IEZyaSwgMiBGZWIgMjAxOCAwNzoxODoxNyArMDAwMA0KUmVjZWl2ZWQ6IGZyb20gS0wxUFIwNk1CMTcyMC5hcGNwcmQwNi5wcm9kLm91dGxvb2suY29tICgxMC4xNjcuNjMuMjIpIGJ5DQogS0wxUFIwNk1CMTA5My5hcGNwcmQwNi5wcm9kLm91dGxvb2suY29tICgxMC4xNjkuMzAuMTUxKSB3aXRoIE1pY3Jvc29mdCBTTVRQDQogU2VydmVyICh2ZXJzaW9uPVRMUzFfMiwgY2lwaGVyPVRMU19FQ0RIRV9SU0FfV0lUSF9BRVNfMjU2X0NCQ19TSEEzODRfUDI1NikgaWQNCiAxNS4yMC40NDQuMTQ7IEZyaSwgMiBGZWIgMjAxOCAwNzoxODoxNCArMDAwMA0KUmVjZWl2ZWQ6IGZyb20gS0wxUFIwNk1CMTcyMC5hcGNwcmQwNi5wcm9kLm91dGxvb2suY29tDQogKFtmZTgwOjpkODRmOmNjNTA6ODkzNDozNmU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Xl3d0FLTA0KZ0FVV1dHQ0JCUllCNnovNUVHQUE1NjBiTjNzeWw1UUFBQUFBU1VWT1JLNUNZSUk9DQoNCi0tXzAwNF9LTDFQUjA2TUIxNzIwQjFFQUNGQjFDNzA3MDZGNkE0NkY4M0Y5MEtMMVBSMDZNQjE3MjBhcGNwXy0tDQo=</t:MimeContent>
          <t:ExtendedProperty>
            <t:ExtendedFieldURI PropertyTag="0x0E07" PropertyType="Integer"/>
            <t:Value>1</t:Value>
          </t:ExtendedProperty>
        </t:Message>
      </m:Items>
    </m:CreateItem>
  </soap:Body>
</soap:Envelope>

The t:MimeContent is the base64 encoded eml which download from office365 server

Thanks!

davster commented 6 years ago

Try to create it as an instead of a message.

joewutaiwan commented 6 years ago

Hi @davster ,

Sorry for late reply, After my trying for other alternatives, I still fail to import or create the message like its origin. And the modification of t:Message -> Item would receive another error

<m:ResponseMessages>
  <m:CreateItemResponseMessage ResponseClass="Error">
    <m:MessageText>MIME conversion is not supported for this item type.</m:MessageText>
    <m:ResponseCode>ErrorUnsupportedMimeConversion</m:ResponseCode>
    <m:DescriptiveLinkKey>0</m:DescriptiveLinkKey>
    <m:Items/>
  </m:CreateItemResponseMessage>
</m:ResponseMessages>

BTW the origin message would look like this image It is a vote that was created and sent from calendar image

Other MeetingRequest works fine in this way.

Thanks!

joewutaiwan commented 6 years ago

Hi sir,

After more investment I found that this type of eml has an additional field header : Content-Class: SeriesMeeting.Request And this makes the operation failed

I want to know this is by design or we have to remove this field manually?

Tahnks!

joewutaiwan commented 6 years ago

Hi @davster ,

Sorry for bother, Do you have any update on this issue?

Thanks!

davster commented 6 years ago

Sorry for the delay. I just looked at the code, and it appears that EWS only supports setting MIME content for PostItem, MessageItem and CalendarItem. I don't recall the history surrounding that decision, but that is what it is currently doing. So the problem with your original code is that you are specifying that it is a Message (via the element), but the MIME includes a different ItemClass and so when EWS tries to save the item, it notices that the resulting ItemClass would change the type to a non message (thereby skipping the various property validations on the new type, etc...).

So off the top of my head, I don't think you can get there from here.

Depending on what exactly you are trying to do, you may want to consider ExportItems/UploadItems which are full fidelity as well, but the blob they deal with is opaque, so if you are trying to either render it or mess with it, you would be out of luck there.