Retrieve a Draft ReplyTo Email from Drafts Folder using EWS soap calls

Pregunta Retrieve a Draft ReplyTo Email from Drafts Folder using EWS soap calls

  • viernes, 27 de julio de 2012 12:45
     
     

    I have successfully saved an Email Reply to the Drafts folder using the NewBodyContent and the ReferenceItemID within CreateItem.  However, I'm having a difficult time of retrieving this information again.  Using Exchange Web Services soap calls, I save the email as follows (note there are some internal Java methods called here, but you should get the idea).  This works and successfully saves the new email item in the Drafts folder:

    "<?xml version=\"1.0\" encoding=\"utf-8\"?>
    <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=\"http://schemas.microsoft.com/exchange/services/2006/messages\">
    <soap:Body>
    <CreateItem xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" MessageDisposition=\"SaveOnly\">
    <SavedItemFolderId xmlns=\"http://schemas.microsoft.com/exchange/services/2006/messages\"><DistinguishedFolderId Id=\"drafts\" xmlns=\"http://schemas.microsoft.com/exchange/services/2006/types\" /></SavedItemFolderId>
    <Items xmlns=\"http://schemas.microsoft.com/exchange/services/2006/messages\">
    <ReplyToItem xmlns=\"http://schemas.microsoft.com/exchange/services/2006/types\">
    <Subject>" + subject + "</Subject>" + buildItemRecips(toRecipients, ccRecipients, bccRecipients, false) + "<ReferenceItemId Id=\"" + referenceId + "\" ChangeKey=\"" + referenceChangeKey + "\" />
    <NewBodyContent BodyType=\"HTML\">" + formatHTML(body) + "</NewBodyContent>
    </ReplyToItem>
    </Items>
    </CreateItem>
    </soap:Body></soap:Envelope>";

    However, when I use GetItem in order to get this item back, the body comes back as merged new content as well as the original reply email.  I was hoping to get back the ReferenceItemId and the NewBodyContent in GetItem so that I can redisplay this information so the user can edit and re-save the email after editing it on the client device before they send it.

    I have searched and searched for a way to get this information...but nothing is coming up.  

    In the GetItem, I do get the following:

    <t:InReplyTo>&lt;36A61B0820901D448AAE2543E4CDD7CB6BBB22@S10MAILD002N1.SH10.lan&gt;</t:InReplyTo>

    Am I supposed to use this field in some way?  If so, how?

    Thanks!

Todas las respuestas

  • lunes, 30 de julio de 2012 15:41
     
     

    Hard to say without seeing how you set the value of the variable named 'body'.  But yes, if you use NewBodyContent when you create the reply, it should set the entire message body (replacing whatever was there) with that value.  At least, it always has for me.  If I want to include the original message text, I have to manually add it to the end.

    Just to clarify, in the response to your CreateItem, there will be a new ItemId.  That is what you should use in your GetItem.  Since you mention getting back the ReferenceItemId in GetItem, I'm not sure if that's what you're doing.


    Mobile OWA For Smartphone
    www.leederbyshire.com
    email a@t leederbyshire d.0.t c.0.m