More ActiveSync

Dominic Michael Salemno


In my previous ActiveSync blog, entitled An ActiveSync Primer, I delved into the basics of the ActiveSync Protocol. This is the second blog in a series intended to thoroughly explain the ActiveSync Protocol.


In my previous blog, I stated that ActiveSync uses HTTPS for its communications channel. This is not necessarily true, only mostlyJ. The truth is that HTTP can be used in place of HTTPS. This is not as secure as the latter. The transport method needed will depend on the Virtual Directory (VDir) configuration on the server.

Each HTTP POST will contain a series of request and response packets. Each command issued by the client will be in the form of a request. The response of course is the return packet from the server containing the results relevant to the preceding request.

Let’s look at an example:

This example fetches an e-mail item from the server.


POST /Microsoft-Server-


DeviceType=PocketPC HTTP/1.1

Content-Type: application/

MS-ASProtocolVersion: 14.0


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

<ItemOperations xmlns:airsync="AirSync:"

xmlns:airsyncbase="AirSyncBase:" xmlns="ItemOperations:">















HTTP/1.1 200 OK

Cache-Control: private

Content-Length: 409

Content-Type: application/

Server: Microsoft-IIS/6.0

MS-Server-ActiveSync: 14.0

Date: Tue, 08 May 2007 17:29:52 GMT


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

xmlns:airsync="AirSync:" xmlns:email="POOMMAIL:"










        <email:To>"deviceuser" &lt;;</email:To>

        <email:Cc>"deviceuser3" &lt;;</email:Cc>

        <email:From>"deviceuser2" &lt;;













          <airsyncbase:Data>Body as plain text</airsyncbase:Data>




        <email:Flag />









The request illustrates using the fetch command to obtain an e-mail message from the server. Subsequently, the server sends out a fetch response containing the requested e-mail message.

This command as well as other commands is explained in much detail in the [MS-ASCMD] document (ActiveSync Command Reference Protocol Specification). This document describes all of the various ActiveSync commands that can be sent over the wire.


The above examples are shown using the XML structures, not WBXML. This is to simplify matters and not in actuality. WBXML is not used for all communications, but most. In the request above, you’ll notice that WBXML is specified in the header:

Content-Type: application/


So really, this message should be encoded using WBXML, but the XML equivalent is shown for simplicity’s sake. This is done across the ActiveSync specification documents found in Microsoft’s Open Specifications.


To reiterate the concept behind ActiveSync, simplistically, ActiveSync ensures the mobile device in question is constantly sending various request packets to the server (usually an Exchange Server) in an effort to maintain the most up-to-date information on the device. Whether this is simply pulling new information from the server, or sending updated information from the device.

All of the protocol documents describing this protocol in detail can be found on Microsoft’s Open Specifications site. Underneath the Exchange Server Protocols section, one will find every document describing this protocol to begin with [MS-AS (AS denoting ActiveSync). All of the documents in question are as follows:
















These documents can be daunting, so in an effort to simplify matters, these series will assist those wanting to learn the protocol in more depth. The next blog will walk through initialization and synchronization of a simple session.