Exchange ActiveSync Building Blocks – AS-WBXML

Index for the series:
Exchange ActiveSync Building Blocks – Intro

Background reading (not a pre-requisite):
[MS-ASWBXML] – Code Pages
Exchange 2010 SP1 IRM – Preamble
Understanding IRM in Exchange ActiveSync
EAS MD – Testing IRM
EAS MD 1.0 – Support for Device Info

I have referred to WBXML a couple of times in this series, but so far not going into any detail other than generically describing it as "ActiveSync language". I’m not attempting to make this seem like "magic" or anything, but when I started hacking around with the Exchange ActiveSync protocol myself I felt that I had to get comfortable with the basic concepts before going into this.

If you recall when we made our first sync attempt with the FolderSync command in a POST I included the following variable as the content of the POST:

//the wbxml required for initial FolderSync
byte[] postBytes =
new byte[13]{03,01,106,00,00,07,86,82,03,48,00,01,01};

I have no idea why I thought it logical to define the bytes with their decimal value rather than the hexadecimal value (which I have used in later WBXMLs). Still; this is a rather short and sweet snippet of WBXML so we should be able to decode it manually by using a lookup table. I’ve converted the values to hex, and "translated" each byte to the plain xml representation.

FolderSync

Read more

Exchange ActiveSync Building Blocks – Error Handling

Index for the series:
Exchange ActiveSync Building Blocks – Intro

Background reading (not a pre-requisite):
[MS-ASCMD] Common Status Codes
[MSDN] WebExceptionStatus Enumeration

If you’ve followed the past couple of articles you’ll no doubt have noticed I haven’t gone out of my way to handle exceptions and errors gracefully. If you run into a problem when running the sample code against an Exchange that for some reason is configured differently than mine, (also known as entirely wrong by definition), you might run into the very helpful “Something happened” message without further explanation.

One might be tempted to ask if it’s because I’m lazy, or simply do not know how to handle it. Well, ask no more, because I now intend to do something about it :) Read more

Exchange ActiveSync Building Blocks – First Sync

Index for the series:
Exchange ActiveSync Building Blocks – Intro

Background reading (not a pre-requisite):
[MS-ASHTTP] – ActiveSync HTTP Protocol – OPTIONS
[MS-ASCMD] – ActiveSync Command Reference – FolderSync
Digging Into The Exchange ActiveSync Protocol

If you followed along with the Autodiscover coding session you have now passed the initial hurdle of locating an ActiveSync-enabled Exchange Server. So how about we try to make a connection with that server and fetch some information from it?

There are three steps you can take in this process, where the last one will also establish a synchronization partnership with Exchange:
- HTTP GET
- HTTP OPTIONS
- HTTP POST

Yes, that’s a very generic description, so let’s describe them further.
Read more

RSS for Posts RSS for Comments