I mentioned when petitioning for feature requests for EAS-MD that I was considering open-sourcing this utility in some form. I haven’t decided on all the details there yet, but I am sort of starting it off now with a series of posts describing, (along with code), the ActiveSync features I’m using in my utility in further details. While having code readily available is a good thing I believe explanations and samples are perfect complements if the object is to learn. Learning by doing is great, but learning by trial-and-error not necessarily equally so. (Sometimes we don’t care how things work, and just want a pre-built black-box component, but that isn’t my primary intent with this site. And besides – you can just use my “official” app for troubleshooting your ActiveSync deployment if you do not need to understand all this stuff. I do understand that most people aren’t that into ActiveSync )
This is the introductory post, which will serve to answer some general questions as well as being updated with links to new posts as they appear.
Part 0 – Warming Up
Part 1 – Autodiscover
Part 2 – First Sync
Part 3 – Error Handling
Part 4 – AS-WBXML
Part 5 – Provisioning
Part 6 – Remote Wipe
Part 7 – DocumentLibrary
Part 8 – WBXML Encode and Decode
Part 9 – GAL Search
Before starting it off with actual code and everything I thought I’d cover some Q & A.
Who is this intended for?
Anyone who wants to learn more about the low-level details of the Exchange ActiveSync protocol. I have covered this topic before to a certain degree:
Also explaining my EAS MD utility:
This might be what you’re looking for as to understanding the protocol, but this time around I intend to go a little bit deeper. For understanding code samples it will of course help to be able to program, but I’ll try to keep it on a level where others might get something out of it too. I don’t consider myself an ActiveSync guru, (they are most likely working at Microsoft), so it probably is not going to go entirely hard core.
Why? Do we need this?
Microsoft has documented it all over at MSDN. The docs are right on, but it’s in a very theoretical format, with no sample code. It is intended as a reference, and not a tutorial, and as such I sometimes find it hard to work with going back and forth between the docs and scratching my head. There are a lot of ActiveSync client implementations available – either as built-in components in mobile devices, or third-party software like TouchDown. I’m not trying to do one better than these, but I haven’t found all that many good sites out there trying to explain it all. So, I thought I could have a crack at it.
Do I need an Exchange Server on my own?
No, not necessarily. Office 365, Gmail, Hotmail, and others support the server parts of ActiveSync and it will probably work with these services as well one installed on your own premises. But there are different versions, and different implementations out there, so there might be differences between these and internally hosted Exchange servers. If you have access to your own Exchange Server this is great, but if you don’t – just try it out and see if it works nonetheless.
If you have access to a company Exchange Server, where you have a regular user account that should work as well. (Make sure your Exchange admin doesn’t have issues with this before doing all sorts of crazy things to his beloved server.)
Do I have to be able to configure Exchange Servers and firewalls and everything? I’m just a programmer!
No, as long as you have access to a working Exchange Server we’re approaching it from the client side and you don’t need to tweak it. There are things you might not be able to test though – for instance testing client certificates and different security policies requires access to the management console. You should however be able to do most things without any access whatsoever. (If something is broken/not working server side you’d probably need access to fix it.)
Do I need to acquire SSL certificates for my server?
No, actually, for testing purposes like this it’s easier without SSL. I’d advice to only do this in a lab environment mind you. It will work with SSL switched on as well, but it will be much harder to troubleshoot the traffic with SSL on.
Which language will you be using?
I’ll be using C#, but the ActiveSync protocol doesn’t require any Microsoft-specific features or esoteric APIs so it should be fully possible to convert it to other languages as well. After all one would assume Apple has used Objective C, and Google hacking it in Java.
What else do I need? Do I need real devices?
It never hurts to have hardware available. I’d highly recommend it. But you can get by without it if you really have to. If you want to have a baseline reference you can download the Windows Mobile emulator from Microsoft. If you’re going for an actual device I think I would recommend an iPhone or iPad as the most ActiveSync compatible at the moment. If you already have an Android, Windows Phone 7, or something – use it, just be aware that there might be minor issues with some features. (Mostly related to handling of security policies.)
So, does this mean I can make my own ActiveSync client and sell as a replacement for the existing clients out there?
Yes, in theory. Well, I’m probably not going to take you all the way; you’ll have to implement parts on your own if this is your goal. Keep in mind though, that while the ActiveSync protocol has an open for all specification it is not royalty free to implement. If you want to use it for commercial purposes you will need to pay license fees to Microsoft.
Anything else of importance? Nah, nothing I can think of right now. We’ll just take it as we go along. I hope “building blocks” turns out to be a suitable series name. As always – shout out if you have feedback.