4.1 FolderSync Request and Response
The following is a typical ActiveSync protocol command request. The FolderSync command, user alias, device ID, and device type are specified as URI query parameters. The Content-Type header specifies that the request body is WBXML. The MS-ASProtocolVersion header specifies that protocol 14.0 is being used. Some command requests contain additional URI query parameters or do not specify a request body. The HTTP POST URI command parameter is the same as the command in the topmost element of the request XML body. For details about the commands and associated XML schema definitions (XSDs), see [MS-ASCMD]. The WBXML-encoded body is decoded for clarity.
Request
-
POST /Microsoft-Server-ActiveSync?Cmd=FolderSync&User=fakename&DeviceId=v140Device&DeviceType=SmartPhone HTTP/1.1 Content-Type: application/vnd.ms-sync.wbxml MS-ASProtocolVersion: 14.0 User-Agent: ASOM Host: Contoso.com <?xml version="1.0" encoding="utf-8"?> <FolderSync xmlns="FolderHierarchy:"> <SyncKey>2</SyncKey> </FolderSync>
The following is a typical FolderSync command response. The status line specifies the HTTP/1.1 protocol and that the command succeeded. The Content-Length header specifies that the response body is 56 bytes and the Content-Type header shows that the response body is in WBXML format. Some command responses do not contain WBXML bodies.
Response
-
HTTP/1.1 200 OK Content-Type: application/vnd.ms-sync.wbxml Date: Thu, 12 Mar 2009 19:34:31 GMT Content-Length: 25 <?xml version="1.0" encoding="utf-8"?> <FolderSync> <Status>1</Status> <SyncKey>2</SyncKey> <Changes> <Count>0</Count> </Changes> </FolderSync>