none
0 byte ActiveSync POSTs RRS feed

  • Question

  • We've encountered a certain Mobile Phone (HTC Touch Pro) running Windows Mobile 6.1 that is sending 0 byte ActiveSync commands to our server. Setting up a brand new relationship, every command it sends is 0 bytes.
     
    For example, it will send a 0 byte FolderSync command, than  0 byte Sync command, even though it's never set up any sync relationship (it only gets to the Sync command if the 0 byte FolderSync is treated as:)
    <FolderSync  xmlns="FolderHierarchy:">
      <SyncKey>0</SyncKey>
    </FolderSync> 

    The Windows Mobile 6.1 emulator does not do this, only the HTC Touch seems to do it. Is this something we need to handle? e.g. is it supported? Why is this happening? I do not see anything in the documentation about this. (Besides the supported 0 byte commands such as ping or sync after a successful version of the command).

    Thanks
    Tuesday, July 28, 2009 11:50 PM

Answers

  • James,

    This is a known issue and I have forwarded the details surrounding this incident to the product group.

    The current work-around is to disable Integrated Windows Authentication (IWA) on IIS.

    Dominic Michael Salemno
    Senior Support Escalation Engineer
    Tuesday, October 20, 2009 6:19 PM

All replies

  • Hi James,

    Thank you for contacting us regarding your quesiton.

    Someone from my team will be contacting you shortly to work on this matter.

    Thanks and regards,

    Sebastian Canevari
    SEBASTIAN CANEVARI - MSFT Senior SEE Protocol Documentation Team
    Wednesday, July 29, 2009 4:59 PM
  • Hi James,

    I am the engineer who has taken ownership of your issue. I am investigating this and shall have an answer for you shortly.

    Dominic Salemno
    Senior Support Escalation Engineer
    Monday, August 3, 2009 12:01 PM
  • James,

    This seems like a logging issue. If the device is functioning, it has to be sending up the body via a FolderSync, there is no other alternative. Try utilizing verbose loggging.

    Dominic Salemno
    Senior Support Escalation Engineer
    Monday, August 3, 2009 12:51 PM
  • Hello Dominic,

    Unfortunately, it isn't a logging issue. I wish. The device is NOT functioning.

    We are developing an ActiveSync server, not using Exchange. We have wireshark packet captures as well as detailed logs from our application which outputs the QueryString, all HTTP headers and the payload for every ActiveSync post. The phone is most definitely sending a FolderSync command with a 0 byte payload.

    What we are wondering is if perhaps there is some undocumented support for 0 byte payloads on all commands that just means use the default value or use the last known good request. For instance, a 0 byte payload for the Sync command just uses the last request from the client. But nowhere in the document (as far as we can tell) allows this for commands such as foldersync.

    If this is supported what is the proper response for "send the whole request"?

    Edit: The phone appears to synchronize correctly when sharing the internet connection via usb/windows mobile device center. When using a cellular data connection it does not. Is there some sort of different algorithm for high bandwidth or low bandwidth connections?
    Monday, August 3, 2009 7:24 PM
  • James,

    Could you send the packet captures and detailed logs you have regarding this issue to dochelp@microsoft.com?

    Dominic Salemno
    Senior Support Escalation Engineer
    Wednesday, August 5, 2009 5:36 PM
  • Email has been sent. Copied here as well for reference:


    WireShark.pcap: A wireshark packet capture of the communication between the device and our server. As can be seen, all packets are content-length: 0 and there is no payload to the POST. This capture records three commands issued by the device. The first POST is a FolderSync, the second is a FolderSync, and the third is a Sync. Our server responds with a 400 Bad Request response to all commands, since there is no payload.

    ActiveSyncLog 2009.07.28.txt: This file is one of two log files produced by our ActiveSync server. Each entry contains the QueryString, HTTP headers, a hex dump of the payload and then the decoded WbXml value. This particular log shows several synchronization attempts. Most POSTs have no payload, however occasionally a payload is included with the FolderSync command. There appears to be no logical reason why some are included and some are not. All responses to the empty payload commands would be a 400 Bad Request error.

    FolderSyncResponse.txt: Occasionally, the device will send a proper FolderSync command with proper payload of SyncKey 0. This is the command request and response as generated by our server. The device always follows up with another FolderSync command with no payload.

    Additionally, we've tried disabling support for ActiveSync 12.1 and having the device connect using 12.0, the same problem occurs. We have not tried falling back to 2.5.

    We are seeing this behavior from three HTC Touch phones using Windows Mobile 6.1.
    The device in question is a HTC Touch using a Sprint connection.
    The latest firmware has been loaded from http://www.htc.com/us/supportdownloadlist.aspx?p_id=76&act=sd&cat=all
    Wednesday, August 5, 2009 10:56 PM
  • James,

    I have received these files and am investigating this issue. I will follow-up with you as things progress.

    Dominic Salemno
    Senior Support Escalation Engineer
    Monday, August 10, 2009 7:02 PM
  • Greetings James,

    I am still investigating this issue and shall have an answer for you shortly.

    Dominic Salemno
    Senior Support Escalation Engineer
    Wednesday, August 26, 2009 12:45 PM
  • We have further isolated the problem. It appears to be some sort of authentication issue. Here is the behavior we are seeing starting with a fresh sync:

    1. Windows Mobile does an OPTIONS request, we respond.
    2. Windows Mobile does a FolderSync command POST with a proper wbxml payload. However, this POST does not contain authentication information, so we respond with a 401 error code.
    3. Windows Mobile does another FolderSync command POST with no wbxml payload. We respond with a 403 error code.
    4. Windows Mobile gives up.

    Here is a wireshark capture of this communication:

    1:
    OPTIONS /Microsoft-Server-ActiveSync?User=admin&DeviceId=BAD73E6E02156460E800185977C03182&DeviceType=PocketPC HTTP/1.1
    Accept-Language: en-us
    X-MS-PolicyKey: 0
    User-Agent: MSFT-PPC/5.2.200
    Host: 10.1.1.98
    Content-Length: 0
    Connection: Keep-Alive
    Cache-Control: no-cache
    
    HTTP/1.1 200 OK
    Date: Thu, 03 Sep 2009 22:33:21 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    MS-Server-ActiveSync: 8.1
    MS-ASProtocolVersions: 2.5,12.0,12.1
    MS-ASProtocolCommands: CreateCollection,DeleteCollection,FolderCreate,FolderDelete,FolderSync,FolderUpdate,GetAttachment,GetHierarchy,GetItemEstimate,ItemOperations,MeetingResponse,MoveCollection,MoveItems,Ping,Provision,ResolveRecipients,Search,SendMail,Settings,SmartForward,SmartReply,Sync,ValidateCert
    Public: OPTIONS,POST
    Allow: OPTIONS,POST
    Cache-Control: private
    Content-Length: 0
    
    2:
    POST /Microsoft-Server-ActiveSync?User=admin&DeviceId=BAD73E6E02156460E800185977C03182&DeviceType=PocketPC&Cmd=FolderSync HTTP/1.1
    Accept-Language: en-us
    MS-ASProtocolVersion: 12.0
    Content-Type: application/vnd.ms-sync.wbxml
    X-MS-PolicyKey: 0
    User-Agent: MSFT-PPC/5.2.200
    Host: 10.1.1.98
    Content-Length: 13
    Connection: Keep-Alive
    Cache-Control: no-cache
    
    ..j...VR.0...
    
    HTTP/1.1 401 Unauthorized
    Date: Thu, 03 Sep 2009 22:33:21 GMT
    Server: Microsoft-IIS/6.0
    WWW-Authenticate: Negotiate
    WWW-Authenticate: NTLM
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Type: text/html
    Content-Length: 18
    
    401 Not Authorized
    
    3:
    POST /Microsoft-Server-ActiveSync?User=admin&DeviceId=BAD73E6E02156460E800185977C03182&DeviceType=PocketPC&Cmd=FolderSync HTTP/1.1
    Accept-Language: en-us
    MS-ASProtocolVersion: 12.0
    Content-Type: application/vnd.ms-sync.wbxml
    X-MS-PolicyKey: 0
    User-Agent: MSFT-PPC/5.2.200
    Host: 10.1.1.98
    Content-Length: 0
    Connection: Keep-Alive
    Cache-Control: no-cache
    Authorization: Basic ZXhhbXBsZS5jb21cYWRtaW46YWRtaW4=
    
    HTTP/1.1 400 Bad Request
    Date: Thu, 03 Sep 2009 22:33:21 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Type: text/html
    Content-Length: 15
    
    400 Bad Request
    




    However, if we turn off "Integrated Windows Authentication" in IIS 6 then everything works as expected. The only difference between a working session and a non working session are the
    WWW-Authenticate: Negotiate
    WWW-Authenticate: NTLM
    
    headers in communication #2. Without these headers, communication #3 works just fine as seen here:
    POST /Microsoft-Server-ActiveSync?User=admin&DeviceId=BAD73E6E02156460E800185977C03182&DeviceType=PocketPC&Cmd=FolderSync HTTP/1.1
    Accept-Language: en-us
    MS-ASProtocolVersion: 12.0
    Content-Type: application/vnd.ms-sync.wbxml
    X-MS-PolicyKey: 0
    User-Agent: MSFT-PPC/5.2.200
    Host: 10.1.1.98
    Content-Length: 13
    Connection: Keep-Alive
    Cache-Control: no-cache
    Authorization: Basic ZXhhbXBsZS5jb21cYWRtaW46YWRtaW4=
    
    ..j...VR.0...
    
    HTTP/1.1 200 OK
    Date: Thu, 03 Sep 2009 22:40:27 GMT
    Server: Microsoft-IIS/6.0
    X-Powered-By: ASP.NET
    X-AspNet-Version: 2.0.50727
    Cache-Control: private
    Content-Type: application/vnd.ms-sync.wbxml
    Content-Length: 348
    
    ..j...VL.1..R.e39da6629fb540c195793e4d3542ecea..NW.5..OH.65dec865c0a34bed96ae8eccc4d46232..I.0..G.Calendar..J.8...OH.30f27fa7407246aabdc6af457361e64e..I.0..G.Contacts..J.9...OH.9d3c2ce7724d4f3da39591b3019b53f4..I.0..G.Tasks..J.7...OH.fb0200f5720d4b96bad81cb363504c5e..I.0..G.Notes..J.10...OH.6788168754564e9aa065d1a445d51988..I.0..G.Inbox..J.2.....
    • Edited by James Lance Thursday, September 3, 2009 10:55 PM code blocks dont look right
    Thursday, September 3, 2009 10:52 PM
  • Thank you James for this new data. I will investigate with this information and follow-up with you shortly.

    Dominic Salemno
    Senior Support Escalation Engineer

    Thursday, September 10, 2009 5:32 PM
  • James,

    We are still investigating this issue. I have no new information at this point in time.

    Dominic Salemno
    Senior Support Escalation Engineer
    Wednesday, September 16, 2009 6:50 PM
  • James,

    This is a known issue and I have forwarded the details surrounding this incident to the product group.

    The current work-around is to disable Integrated Windows Authentication (IWA) on IIS.

    Dominic Michael Salemno
    Senior Support Escalation Engineer
    Tuesday, October 20, 2009 6:19 PM
  • James,

    Even we also facing the same issue for Netbook Android device. Where are in Android G1 it works perfectly fine. Is there anyway that we can take care in http connections?

    Please help us.

    Thanks in advance
    • Proposed as answer by snydpu Tuesday, November 17, 2009 11:40 AM
    Thursday, October 22, 2009 2:15 PM
  • Hi James,

    Good Day!

    From the trace that you have pasted in this thread, i found that you are checking for authentication information in the "POST" request instead why don't you check the same when the "OPTIONS" request was happened and respond the client that it is unauthorized then the client will send another "OPTIONS" request with the authorization information at this place you respond with your proper "OPTIONS" response and proceed, hope this will solve your issue.


    • Proposed as answer by snydpu Tuesday, November 17, 2009 11:41 AM
    Thursday, November 12, 2009 7:11 AM