New to Exchange ActiveSync Development?

One area I do developer support for is EAS development with those who have an EAS client development license and have a specific support agreement in their Premier contract for EAS developer support - these are needed to get any EAS developer support from Microsoft. Developers who do not have these should consult the online EAS forums for assistance. Server-side EAS development is not eligible for developer support, however you should look into licensing. I've put together some basic information which might be helpful to anyone doing EAS development and would like to share it.

If your considering doing EAS development, you should understand a few points. First, there is no Microsoft API which wraps calls to Exchange Server ActiveSync. What this means is that you will need to write code to build blobs of WBXML content and implement a lot of business logic - this is no minor undertaking. The developers who write EAS client calls pretty much all work for phone manufacturers. Its way far more easier to write Exchange Web Service (EWS) code than to do all the work for working with EAS. EAS is geared to be a very light-weight client and does have some limitations as a result. The second big thing to consider is this - Licensing. Before you have made a decision to use EAS, you need to go over the licensing and should have a discussion with Microsoft on licensing.

Here is information on licensing:

Microsoft Technology Licensing
https://www.microsoft.com/en-us/legal/intellectualproperty/mtl/technologylicensing.aspx
See the "Exchange ActiveSync Protocol" node.

Microsoft Expands Exchange ActiveSync Licensing Program
https://news.microsoft.com/2008/12/18/microsoft-expands-exchange-activesync-licensing-program/

The Exchange ActiveSync (EAS) documentation is included with the Exchange Server Protocol Documents. The EAS documents start with “MS-AS”. Note that they start with the 12.x version of EAS. There currently no public version specific versions of these documents. MS-ASCMD is the document which is most often used and covers EAS commands. Note that you will likely need to consult the other non-EAS specific documents as you develop and troubleshoot your client. If you are looking for the documents covering the older versions of EAS (such as 2.5), you will need to engage Microsoft for a discussion on lincensing - they are not public.

Exchange Server Protocol Documents
https://msdn.microsoft.com/en-us/library/cc425499(EXCHG.80).aspx

Here are other documents which should be helpful:

Microsoft Exchange Server Interoperability Guidance
https://msdn.microsoft.com/en-us/library/hh285606(EXCHG.140).aspx

Implementing an Exchange ActiveSync client: the transport mechanism
https://msdn.microsoft.com/en-us/library/hh361570(EXCHG.140).aspx

About: Exchange Server ActiveSync (EAS)
https://blogs.msdn.com/b/webdav_101/archive/2015/06/01/about-exchange-server-activesync-eas.aspx

 Best Practices with EAS:

ActiveSync
https://blogs.msdn.com/b/exchangedev/archive/tags/exchange+activesync  

Weekly Roundup: April 15, 2011 – EAS Logo Program Edition
https://blogs.msdn.com/b/mstehle/archive/2011/04/15/weekly-roundup-april-15-2011-eas-logo-program-edition.aspx

Check connectivity for EAS and other protocols. 

Remote Connectivity Analyzer
https://www.testexchangeconnectivity.com 

Use this to see if the connectivity issue is with your client or the Exchange server your going against.

Phone emulators:

Windows Mobile 6.1.4 Emulator Images.
https://www.microsoft.com/download/en/details.aspx?id=9263

Windows Mobile 6.5 Developer Tool Kit
https://www.microsoft.com/en-us/download/details.aspx?id=17284

Windows Phone Emulator (Windows Phone 8 | Windows Phone OS 7.1)
https://msdn.microsoft.com/en-us/library/windowsphone/develop/ff402563(v=vs.105).aspx

However, the Windows Phone Emulator's do not save client side logs. However, the Windows Phone Emulator's do not save client side logs.

OWA 2010 Sever Side Logging for EAS:

You can get server side logs easily by having OWA mail them to you. In order to do this you must have synced your device against your mailbox at least one time.

 Log into OWA

Click on Options on the far right

Click See All Options…

On the left of the Options Window, click Phone

Click on the phone icon, which is labeled “Mobile Phones”.

At this point you should see a list of devices which have synced.

Select a device by clicking on it.

Click Start Logging…

… read the pop-up window text and click Yes…

… do your EAS sync operations from your device you wish to capture…

… with the device selected in OWA, click Retrieve Log

Go into your Inbox and look for an email with the EAS traffic in an attachment. 

Administer ActiveSync:

 Microsoft Exchange Server ActiveSync Web Administration Tool
https://www.microsoft.com/download/en/details.aspx?displaylang=en&id=22243

 Upgrading Exchange ActiveSync to Exchange 2010
https://blogs.technet.com/b/exchange/archive/2009/12/08/3408985.aspx

Use Exchange PowerShell to get statistical information for Exchange Server ActiveSync
https://blogs.msdn.com/b/webdav_101/archive/2011/09/28/use-exchange-powershell-to-get-statistical-information-for-exchange-server-activesync.aspx

Exchange 2007 ActiveSync policies
https://blogs.technet.com/b/exchange/archive/2007/05/23/3402905.aspx

Microsoft Exchange Server ActiveSync Web Administration Tool (Exchange 2003 SP2 & 2007 SP1)
https://www.microsoft.com/download/en/details.aspx?displaylang=en&id=22243

Understanding Exchange ActiveSync Mailbox Policies (Exchange 2010 SP1)
https://technet.microsoft.com/en-us/library/bb123484.aspx

Managing Exchange ActiveSync with Policies (Exchange 2010 SP1)
https://technet.microsoft.com/en-us/library/bb123783.aspx

Troubleshooting ActiveSync:

Unable to connect using Exchange ActiveSync due to Exchange resource consumption
https://support.microsoft.com/kb/2469722

A script to troubleshoot issues with Exchange ActiveSync
https://blogs.technet.com/b/exchange/archive/2012/01/31/a-script-to-troubleshoot-issues-with-exchange-activesync.aspx

2.2.4 Common Status Codes
https://msdn.microsoft.com/en-us/library/ee218647(EXCHG.80).aspx

2.2.3.162 Status
https://msdn.microsoft.com/en-us/library/ee218647(EXCHG.80).aspx

Tools for diagnosing EAS issues:

Announcing Fiddler Inspector for Exchange Server ActiveSync
https://blogs.msdn.com/b/webdav_101/archive/2013/07/05/announcing-fiddler-inspector-for-exchange-server-activesync.aspx

Announcing EASTester
https://blogs.msdn.com/b/webdav_101/archive/2013/06/28/announcing-eastester.aspx

Log Parser Studio
Log Parser Studio is a utility that allows you to search through and create reports from your IIS, Event, EXADB and others types of logs. It can be used to diagnose issues with ActiveSync and has pre-built reports for many different EAS issues. You can also create you own custom searches.

Getting Started with Log Parser Studio
https://blogs.technet.com/b/karywa/archive/2013/04/21/getting-started-with-log-parser-studio.aspx

Log Parser Studio - download
https://gallery.technet.microsoft.com/Log-Parser-Studio-cd458765

Here are some questions which will often be asked if you get an EAS Licensee support case opened:

 Does the problem happen with a Windows Mobile Phone, Windows Phone 7 or the Remote Connectivity Analyzer? 

The answer is very important because if occurs with one of these, the problem is likely not with your code and would most likely be considered an Exchange server issue rather than a client development issues. I’m in a developer support team which handle client development for EAS licensees. However there is a different team which handles Exchange server issues with EAS as a product issue.

Which version of EAS was used?:

Not all problems may occur with all versions of EAS. Further, EAS has additional capabilities or might work differently in later or even earlier versions of the protocol.

Is the Exchange CAS and Exchange Mailbox on the latest Service Pack and rollup?

The EAS server side component runs on the Exchange CAS, so having it up to date is important. However, mailbox issues could also affect results with EAS, not to mention any other API – so it should also be kept-up in patching. What helps in seeing if a problem has been fixed is to go against a fully patched server in testing. Some customers prefer to do this and also do testing with an server which has not been kept up to date. The current service pack of Exchange and the prior one are what is supported at each major Exchange version level (2007 and 2010). If there is a perceived bug, then we would need to know if the issue happens with a fully patched box. Telling the patch level can be difficult since the rollup level may not always be accurately reported in some areas of Exchange – however, the following article shows how to check.

Dude, where's my rollup?
https://blogs.technet.com/b/exchange/archive/2010/03/08/3409469.aspx

         Do you have admin access or can work with someone on your end with admin access to Exchange?

In some cases certain types of logs will be needed which would require Exchange Admin access. When this is the case, it may become necessary to have special logs taken on the Exchange server. Please note that if you need a Microsoft engineer to pull the logs from a BPOS server, you would need to open a BPOS support case – this is because access to those servers is highly restricted and only BPOS engineers have access.

Have you looked at server-side EAS logs?

The traffic taken from server-side logging from OWA generated EAS logs could be compared between your EAS device and that of a Windows Mobile Phone or Windows Phone 7 to see what the differences are. Further, server logs containing your devices traffic may reveal more clues as to the cause of the problem. 

How do I see what a client might send?

Some clients have logging built in so that you can see what is being sent - Windows Mobile phones can do this, however Windows Phone 7 currently cannot. You could however use the EAS logging in OWA to get a trace of EAS traffic while syncing a device. 

When clients send email, it will go through Exchange transport as SMTP traffic. Exchange has a feature called Pipeline Tracing which captures SMTP traffic so that you can see what is being sent. Note that this approach can capture any SMTP traffic - not just that which initiated from an EAS device.

Using Pipeline Tracing to Diagnose Transport Agent Problems
https://technet.microsoft.com/en-us/library/bb125198(EXCHG.80).aspx

Enable Pipeline Tracing
https://technet.microsoft.com/en-us/library/bb125018.aspx

Netmon and other network tracers could capture the traffic of EAS calls; however, such traffic is WBXML encoded, so you would need a WBXML decoder to see the traffic in a more readable format. EASTester can decode WBXM exported from Netmon, Fiddler and WireShark. The EAS Inspector for Fiddler can be used to quickly display WBXML bodies as XML.

EAS Inspector for Fiddler
https://easinspectorforfiddler.codeplex.com/

EASTester
https://eastester.codeplex.com/

MIME and ICS/VCALENDAR content:

MIME and ICS/VCALENDAR content is base-upon public RFCs. There is no developer support for the formation or parsing of such data outside of an supported Microsoft API which does such operations. However, there is support for reading and submitting such content with EAS. While I and others here can read and understand the basics of such content, it is not something which we would have depthful expertise on. If you find that Exchange is not handling or generating RFC compliant MIME, it would be handled as a product issue and would moreover be supported.

vCard [MS-OXVCARD]
https://msdn.microsoft.com/en-us/library/dd633489.aspx

iCalendar [MS-OXCICAL]
https://msdn.microsoft.com/en-us/library/cc463911.aspx

Microsoft Protocol Programs
https://www.microsoft.com/protocols/default.mspx

List of Protocols User Forums
https://msdn.microsoft.com/en-us/library/cc320426(PROT.10).aspx

What have EAS clients implemented?

Exchange ActiveSync Client Comparison Table
https://social.technet.microsoft.com/wiki/contents/articles/exchange-activesync-client-comparison-table.aspx

Comparison of Exchange ActiveSync clients
https://en.wikipedia.org/wiki/Comparison_of_Exchange_ActiveSync_Clients

Implementing an Exchange ActiveSync client: the transport mechanism
https://msdn.microsoft.com/en-us/library/hh361570(EXCHG.140).aspx

How do I know what fields and operations are used by each version or what to implement?:

If you browse under the Exchange folders you will find which contains the XSD for each EAS version.  This is path is "Program Files\Microsoft\Exchange Server V14\ClientAccess\sync\Xsd" for Exchange 2010. If you combine this with the Exchange Protocal docs which start with "MS-AS", you can get an idea of what  needs to be encode WBXML wise.

Exchange Server Protocol Documents
https://msdn.microsoft.com/en-us/library/cc425499(EXCHG.80).aspx

Some points on EAS development:

You can get a feel for what client code for WBXML encoding and decoding would look like by going over the sample in the link below.

Implementing an Exchange ActiveSync client: the transport mechanism
https://msdn.microsoft.com/en-us/library/hh361570(EXCHG.140).aspxJust

[MS-ASWBXML]: ActiveSync WAP Binary XML (WBXML) Algorithm
https://msdn.microsoft.com/en-us/library/cc425499(EXCHG.80).aspx

Being able to encode and decode WBXML is not enough - remember, the developer needs to write all the business logic when developing for an EAS, You will really need to nail the business logic for each operation. Not getting the business logic down will cause your user great grief and can greatly impact the adoption of your client - Remember, end-administrators can and often block clients by device type. You should also do some very robust testing to be sure that the code is sound. Below are documents which cover some of the aspects. 

Microsoft Exchange Server Interoperability Guidance
https://msdn.microsoft.com/en-us/library/hh285606(EXCHG.140).aspx

Working with meeting requests in Exchange ActiveSync
https://blogs.msdn.com/b/exchangedev/archive/2011/07/22/working-with-meeting-requests-in-exchange-activesync.aspx

Working with meeting responses in Exchange ActiveSync
https://blogs.msdn.com/b/exchangedev/archive/2011/07/29/working-with-meeting-responses-in-exchange-activesync.aspx

The following link is a basic client sample which uses code from the Microsoft Exchange Server Interoperability Guidance documents

Exchange 2010: Implementing Exchange ActiveSync Folder Sync
https://code.msdn.microsoft.com/Exchange-2010-Implementing-400b9507

You should also be sure to implement Autodiscover. This is something which makes the lives of administrators and users much easier. Be sure to do a full implementation - otherwise your code will not be reliable. The article below was written by the Exchange product team and should be 100% implemented:

Autodiscover for Exchange ActiveSync developers
https://blogs.msdn.com/b/exchangedev/archive/2011/07/08/autodiscover-for-exchange-activesync-developers.aspx

Be sure to fully implement provisioning correctly:

Provisioning, Policies, Remote Wipe, and ABQ in Exchange ActiveSync
https://blogs.msdn.com/b/exchangedev/archive/2011/08/19/provisioning-policies-remote-wipe-and-abq-in-exchange-activesync.aspx

How do I get EAS to do delegate access (shared mailbox) or Impersonated access?

EAS is not supported with delegate access. Delegate access is what is used for shared mailbox access. It also does not support impersonated access. EAS should only meant for a user to access their own email, calendar, contacts, etc. This is true for all versions of EAS between 2.5 and 14.1.

MIME and ICS/VCALENDAR content:

MIME and ICS/VCALENDAR content is base-upon public RFCs. There is no developer support for the formation or parsing of such data outside of an supported Microsoft API which does such operations. However, there is support for reading and submitting such content with EAS. While I and others here can read and understand the basics of such content, it is not something which we would have depthful expertise on. If you find that Exchange is not handling or generating RFC compliant MIME, it would be handled as a product issue and would moreover be supported.

vCard [MS-OXVCARD]
https://msdn.microsoft.com/en-us/library/dd633489.aspx

iCalendar [MS-OXCICAL]
https://msdn.microsoft.com/en-us/library/cc463911.aspx

Microsoft Protocol Programs
https://www.microsoft.com/protocols/default.mspx

List of Protocols User Forums
https://msdn.microsoft.com/en-us/library/cc320426(PROT.10).aspx

Some areas which cause many problems are:

Not implementing Autodiscovery or not doing it properly - this makes work so much more difficult for users when its not implemented or fails to work. Be sure to fully handle the different types of redirects - there are several types.

Not correctly and honestly implementing provisioning correctly. Clients really need to honor provisioning correctly so that administrators and user can trust the EAS devices being used. This is a big thing for the Exchange Logo program.

Please note that if you have any EAS specific questions that I will not answer them here. However, I do hope that the information provided in this posting is helpful.