none
SmartReply returns status 150 RRS feed

  • Question

  • I've been beating my head against this particular problem for a while and I can't figure out what is going on. I'm hoping someone here can shed some light on it.

    I am working on a AS client and things have overall been going well. I also have a test harness set up so that I can actively test sending XML to Exchange.  The test harness and device code are both using the same WBXML transform class and barring occasional formatting differences (like carriage returns) they get identical results from the transform. As far as I can tell the headers on the HttpRequest are the same as well. All of this makes the fact that I'm getting different results very confusing.

    The testharness sends replies to messages just fine. But the device code keeps getting a status 150 (Item Not Found) every time I try to reply.

    POST https://<<server>>/Microsoft-Server-ActiveSync?Cmd=SmartReply&User=<<userId>>&DeviceId=<<device id>>&DeviceType=<<device Type>> HTTP/1.1
    Host: <<host>>
    Content-Length: 644
    MS-ASProtocolVersion: 14.1
    X-MS-PolicyKey: 2008822308
    UserAgent: <<agent>>
    Connection: Keep-Alive
    Content-Type: application/vnd.ms-sync.wbxml
    Expect: 100-continue
    Authorization: Basic cmVkd2Fnb24ubG9jYWxca3JhbWVydGVzdDE6RGlnaXRhbDE=

     <?xml version="1.0"?>
     <SmartReply xmlns="ComposeMail:">
    <ClientID>A97BD79D-BF5A-4222-91B2-CEB8504C0000</ClientID>
    <Source>
    <FolderId>7</FolderId>
    <ItemId>7:1</ItemId>
    </Source>
    <Mime><![CDATA[From: <<from>>
    To: <<original recipient>>
    Cc:
    Bcc:
    Subject: Re: test

    MIME-Version: 1.0
    Content-Type: text/plain; charset="iso-8859-1"
    Content-Transfer-Encoding: 7bit
    X-MimeOLE: Produced by HubCap V1




    ------------------------------
    From: <<original recipient>>
    Sent: Monday, August 5, 2013 at 4:44 PM
    To: <<eail address>>
    Subject: test


    ]]></Mime>
     </SmartReply>
     
     To make things simpler on myself I cleared out the test account that I am using. It has only one email in it's inbox, which is what I am trying to reply to. The Folder's ID is 7, the item's ID is 7:1. I can verify this by doing a sync in my test harness. The device also has this information and is using it. The device IS provisioned and is sending it's policy key in the header of the request.
     
     To do an outbound capture, I turned the command line from HTTPS to HTTP so that i could use Wireshark to see exactly what is being sent. Unfortunately I couldn't get Wireshark to successfully decrypt the HTTPS request, so it had to be done.  To get this result i first tried to reply from the device. Then I copy/pasted the XML from my console window into my testharness and tried from there. Anyway this is what I got.
     
    0000   78 2b cb 5f ce 5f 00 25 64 05 c2 5e 08 00 45 00
    0010   02 18 65 3d 40 00 80 06 7e 06 0a 0a 00 75 0a 0a
    0020   01 14 fc da 00 50 e5 78 55 70 0a 85 99 b9 50 18
    0030   00 fb 97 67 00 00 03 01 6a 00 00 15 47 51 03 36
    0040   34 41 42 45 36 34 34 2d 42 46 35 41 2d 34 32 32
    0050   32 2d 39 31 42 32 2d 43 45 42 38 35 30 34 43 30
    0060   30 30 30 00 01 4b 4c 03 37 00 01 4d 03 37 3a 31
    0070   00 01 01 50 c3 83 2d 46 72 6f 6d 3a 20 3c 4b 52
    0080   41 4d 45 52 54 45 53 54 31 40 4c 52 57 54 45 43
    0090   48 4e 4f 4c 4f 47 49 45 53 2e 43 4f 4d 3e 0d 0a
    00a0   54 6f 3a 20 3c 53 57 65 74 68 65 72 61 6c 64 40
    00b0   6c 72 77 74 65 63 68 6e 6f 6c 6f 67 69 65 73 2e
    00c0   63 6f 6d 3e 0d 0a 43 63 3a 20 0d 0a 42 63 63 3a
    00d0   20 0d 0a 53 75 62 6a 65 63 74 3a 20 52 65 3a 20
    00e0   74 65 73 74 0d 0a 4d 49 4d 45 2d 56 65 72 73 69
    00f0   6f 6e 3a 20 31 2e 30 0d 0a 43 6f 6e 74 65 6e 74
    0100   2d 54 79 70 65 3a 20 74 65 78 74 2f 70 6c 61 69
    0110   6e 3b 20 63 68 61 72 73 65 74 3d 22 69 73 6f 2d
    0120   38 38 35 39 2d 31 22 0d 0a 43 6f 6e 74 65 6e 74
    0130   2d 54 72 61 6e 73 66 65 72 2d 45 6e 63 6f 64 69
    0140   6e 67 3a 20 37 62 69 74 0d 0a 58 2d 4d 69 6d 65
    0150   4f 4c 45 3a 20 50 72 6f 64 75 63 65 64 20 62 79
    0160   20 48 75 62 43 61 70 20 56 31 0d 0a 2d 2d 2d 2d
    0170   2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d
    0180   2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 0d 0a 46 72 6f 6d
    0190   3a 20 22 53 63 6f 74 20 57 65 74 68 65 72 61 6c
    01a0   64 22 20 3c 53 57 65 74 68 65 72 61 6c 64 40 6c
    01b0   72 77 74 65 63 68 6e 6f 6c 6f 67 69 65 73 2e 63
    01c0   6f 6d 3e 0d 0a 53 65 6e 74 3a 20 4d 6f 6e 64 61
    01d0   79 2c 20 41 75 67 75 73 74 20 35 2c 20 32 30 31
    01e0   33 20 61 74 20 34 3a 34 34 20 50 4d 0d 0a 54 6f
    01f0   3a 20 3c 6b 72 61 6d 65 72 74 65 73 74 31 40 6c
    0200   72 77 74 65 63 68 6e 6f 6c 6f 67 69 65 73 2e 63
    0210   6f 6d 3e 0d 0a 53 75 62 6a 65 63 74 3a 20 74 65
    0220   73 74 0d 0a 01 01
     
     But I get back a simple response of:
     
     <SmartReply xmlns="ComposeMail">
    <Status>150</Status>
     </SmartReply>
     
     This error is ItemNotFound
     
     
     Wireshark also adds in an interesting (though I'm not sure it's relevant) bit of: 
     
     WAP Binary XML, Version: 1.3, Public ID: "Unknown or missing public identifier"
      It then proceeds to decode the WBXML. But it does in fact show that there is a Source node with FolderId and ItemId both set correctly.
     
     Level | State | Codepage | WBXML Token Description         | Rendering
           | Tag   | T --> 21 | SWITCH_PAGE (Tag code page)     |
         0 | Tag   | T  21    |   Known Tag 0x07           (.C) |  <SmartReply>
    1 | Tag   | T  21    |   Known Tag 0x11           (.C) |    <ClientId>
         1 | Tag   | T  21    | STR_I (Inline string)           |    '67D165D7-BF5A-4222-91B2-CEB8504C0000'
         1 | Tag   | T  21    | END (Known Tag 0x11)            |    </ClientId>
    1 | Tag   | T  21    |   Known Tag 0x0B           (.C) |    <Source>
         2 | Tag   | T  21    |   Known Tag 0x0C           (.C) |      <FolderId>
    2 | Tag   | T  21    | STR_I (Inline string)           |      '7'
    2 | Tag   | T  21    | END (Known Tag 0x0C)            |      </FolderId>
    2 | Tag   | T  21    |   Known Tag 0x0D           (.C) |      <ItemId>
    2 | Tag   | T  21    | STR_I (Inline string)           |      '7:1'
    2 | Tag   | T  21    | END (Known Tag 0x0D)            |      </ItemId>
    1 | Tag   | T  21    | END (Known Tag 0x0B)            |    </Source>
    1 | Tag   | T  21    |   Known Tag 0x10           (.C) |    <MIME>
    1 | Tag   | T  21    | OPAQUE (Opaque data)            |    (441 bytes of opaque data)
    1 | Tag   | T  21    | END (Known Tag 0x10)            |    </MIME>
    0 | Tag   | T  21    | END (Known Tag 0x07)            |  </SmartReply>
     
    I have to admit that Wireshark decoding the WBXML on it's own is pretty cool. But it seems to be showing the XML is correct. Folder - 7, Item -  7:1  

     I can compose new emails from both locations without a hitch. But when i try to reply (and presumably to forward) I get this error. Might anyone have any idea what exactly is going on here?
     
     Thanks,
     
     CK.
     
     
     
     

     

     

    Monday, August 5, 2013 7:51 PM

Answers

  • Nevermind, but thanks.

    As it turns out, the code was actually working and has been for about a week. The parameters the code was passed for folderId and itemId were not correct. Which was causing it to not be able to find the message.

    Once I figured that out everything worked.

    Thanks for your time in any case.

    • Marked as answer by Cosmo Kramer Thursday, August 8, 2013 1:01 PM
    Thursday, August 8, 2013 1:01 PM

All replies

  • According to the WAP Binary XML Content Format document at www.w3.org/TD/wbxml

    the Public identifier that Wireshark is referring to is a WAP specification document and not related to the message's Folder or Item ids.

    Monday, August 5, 2013 7:55 PM
  • Hi CK,

    Thank you for posting on the MSDN Forum. One of our support engineers will respond soon.

    Regards,
    Vilmos Foltenyi - MSFT

    Monday, August 5, 2013 8:43 PM
  • Hi CK,

    I am the engineer who will be working with you on this issue. I am currently researching the problem and will provide you with an update.

    Regards,
    Vilmos Foltenyi - MSFT

    Tuesday, August 6, 2013 11:25 PM
  • Nevermind, but thanks.

    As it turns out, the code was actually working and has been for about a week. The parameters the code was passed for folderId and itemId were not correct. Which was causing it to not be able to find the message.

    Once I figured that out everything worked.

    Thanks for your time in any case.

    • Marked as answer by Cosmo Kramer Thursday, August 8, 2013 1:01 PM
    Thursday, August 8, 2013 1:01 PM