none
Exchange ActiveSync - how to retrieve ServerID from a LongID RRS feed

  • Question

  • Hi,

    We have an app that uses Exchange ActiveSync to search for emails using Search command. This gives us a list of LongIDs. We then want to mark the email item referred by that email as Read using the Sync and Change command using something like:

    <?xml version="1.0" encoding="utf-8"?>

    <Sync xmlns="AirSync" xmlns:airsyncbase="AirSyncBase" xmlns:email="Email">

    <Collections>

    <Collection>

    <SyncKey>1370574689559</SyncKey>

    <CollectionId>Mail:DEFAULT</CollectionId>

    <GetChanges>0</GetChanges>

    <Options>

    <FilterType>2</FilterType>

    <airsyncbase:BodyPreference>

    <airsyncbase:Type>4</airsyncbase:Type>

    <airsyncbase:TruncationSize>32768</airsyncbase:TruncationSize>

    </airsyncbase:BodyPreference>

    </Options>

    <Commands>

    <Change>

    <ServerId>5:1</ServerId>

    <ApplicationData>

    <email:Read>1</email:Read>

    </ApplicationData>

    </Change>

    </Commands>

    </Collection>

    </Collections>

    </Sync>

    But since this XML can only use a ServerID, we can't use the LongID we got from Search command. So, how does one retrieve the ServerID from LongID so we can mark the email as Read?

    Thanks.

    Saturday, June 8, 2013 1:39 AM

Answers

  • Hi CLActiveSyncUser, the definitive answer from the developer in charge of EAS development is that there is no current way to convert a LongID to a ServerID. There is also not a way to use the LongID in a request for a message that will return the ServerID for the same message. I was incorrect when I said that it was possible to use the LongID in a Fetch to get the ServerID. Your request for this functionality has been noted and it will be considered for a future version of the EAS protocol.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Monday, July 15, 2013 7:34 PM
    Moderator

All replies

  • Hi,

    Thank you for raising this question. One of our engineers will investigate this and follow-up with you soon.

    Regards,

    Edgar

    Saturday, June 8, 2013 5:40 AM
    Moderator
  • Hi CLActiveSyncUser, there is no direct conversion between ServerID and LongID. This question has been discussed before in the following threads. Please take a look at these and let me know if you have any other questions.

     

    http://social.msdn.microsoft.com/forums/en-us/os_exchangeprotocols/thread/4F0C3CAF-9FB1-4B81-864B-C0227D1CDE2F

     

    http://social.msdn.microsoft.com/Forums/en-US/os_exchangeprotocols/thread/48d7f3cc-5a9a-4e72-a846-983ae65e7213


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Monday, June 10, 2013 6:06 PM
    Moderator
  • Josh,

    Thanks very much for your links, and for your response. I am aware of these and the fact that there is no direct relationship between LongID and ServerID.

    My question is:

    If I have a LongID (obtained from Search command), and I retrieve that email for reading. Now, I want to mark that email as "read". To do this, I need the ServerID. How do I find out what the ServerID is for that email? Is there a sequence of Sync and Fetch commands which will allow me to retrieve just that email and its ServerID?

    Thanks


    Monday, June 10, 2013 6:49 PM
  • Hi CLActiveSyncUser, I believe the following response from the first link I posted addresses your issue.

     

    "There is no direct conversion possible from LongId to ServerId. However, you could perform a search query as outlined in [MS-ASCMD] (http://msdn.microsoft.com/en-us/library/dd299441.aspx) in Section 4.5.3 to obtain the LongId of a message. Subsequently, you then could use the LongId in a Fetch operation to retrieve the message in question (Detailed in Section 4.5.3.4)."

     

    The ServerID will be contained in the Fetch response.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Monday, June 10, 2013 9:03 PM
    Moderator
  • Josh,

    Are we looking at different protocol documents? I noticed that the 4.5.3.4 doesn't exist in the link you reference above, and 4.5.3 section is "Uploading new ApplicationData to the Server." Please let me konw where the Fetch operation is detailed.

    Thanks

    Tuesday, June 11, 2013 12:36 AM
  • I think the new protocol document reference is 4.10.3.4 (Fetch Response), but that does not have ServerID. We also confirmed that ServerID is not returned in the response XML. How do we request that for a Fetch, we get the ServerID?

    Tuesday, June 11, 2013 1:01 AM
  • Josh,

    Any update on the above request and observations?

    Thanks

    Wednesday, June 12, 2013 4:52 PM
  • Hi CLActiveSyncUser, I am still looking into this issue. I hope to have more information for you soon. Your patience is greatly appreciated.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Wednesday, June 12, 2013 7:35 PM
    Moderator
  • Hi CLActiveSyncUser, I am continuing to research this issue. I expect to have more information by the end of the week. Thank you for your patience.

    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Monday, June 24, 2013 6:45 PM
    Moderator
  • Josh,

    Any update on this issue?

    Thanks.

    Tuesday, July 2, 2013 5:46 PM
  • Hi CLActiveSyncUser, we have concluded that it is not possible to obtain the ServerID for a message given the LongID other than the way previously mentioned. Because the ServerID is optional in the Fetch result there is no guarantee that you will get the ServerID. There is also not a way to force it to return the ServerID in the response.

    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Tuesday, July 2, 2013 8:26 PM
    Moderator
  • So, how does one mark an item as a Read item? I want to describe what I want to do, and find out how to do it.

    If I have a LongID (obtained from Search command), and I retrieve that email for reading. Now, I want to mark that email as "read". To do this, I need the ServerID. How do I find out what the ServerID is for that email? Is there a sequence of Sync and Fetch commands which will allow me to retrieve just that email and its ServerID?

    Thanks.

    Tuesday, July 2, 2013 8:33 PM
  • Josh,

    I can't figure out what you mean by:

    " other than the way previously mentioned. "

    What particular way are you referring to? Your previous reference with the yellow highlighted text was not right, because the document doesn't have the highlighted text.

    Thanks.

    Friday, July 12, 2013 10:54 PM
  • Hi CLActiveSyncUser, the definitive answer from the developer in charge of EAS development is that there is no current way to convert a LongID to a ServerID. There is also not a way to use the LongID in a request for a message that will return the ServerID for the same message. I was incorrect when I said that it was possible to use the LongID in a Fetch to get the ServerID. Your request for this functionality has been noted and it will be considered for a future version of the EAS protocol.


    Josh Curry (jcurry) | Escalation Engineer | Open Specifications Support Team

    Monday, July 15, 2013 7:34 PM
    Moderator