Posts Tagged ‘SyncML’

WBXML for .Net

Synchronisation of data between multiple devices is important to have information at every place at every time. For example, I want to have my work agenda items on my mobile phone so that I have a quick overview (and get a notification) when I have a meeting. 

There are different protocols for data synchronization. To synchronize my mobile agenda with work (which makes use of Oracle Collaboration Suite) I have to use SyncML. There are some commercial products available (I used the SyncML client of Synthesis AG on my Windows Mobile Device, which is very good) but I am a developer and I wanted to know how SyncML works. 

When reading the SyncML specification  I tried to initiate a fresh synchronisation (from the server to a mobile which has an empty agenda). Sending message to the Oracle server was working, but the response I got back was not correct (the SyncML messages where accepted but the agenda items where not send back). I wanted to compare those messages to the ones (commercial) SyncML applications where sending… but I found out that these where using WBXML.

What is WBXML?

WBXML stands for WAP Binary XML. It is used to send XML in a compact way to reduce bandwidth (which is limited for a mobile device when using GPRS). For example the content of the following XML (as defined in the WBXML specification as an example)

<br />
<XYZ><CARD><br />
     X &amp; Y<BR /><br />
     X=1<br />
</CARD></XYZ><br />

will be in WBXML (hex notation):

03 01 03 00 47 46 03 0D 0A 20 20 20 20 20 58 20 26 20 59 00 05 03 0D 0A 20 20 20 20 20 58 00 02 81 20 03 3D 00 02 81 20 03 31 20 0D 0A 20 20 00 01 01

Interested by the use of this encryption I started reading the WBXML specification. I searched on the Internet if there where any WBXML libraries for .Net but couldn’t find one. So i decided to write my own.

At CodeProject I found a blog written by Tamir Khason about a WBXML parser for C#. Comparing it to the WBXML specification (and also referencing to his own remarks on the blog) the parser is not following the specification. I liked the idea of extending the XMLDocument of .Net and used that as a base of the WBXMLDocument class.

The code of the WBXML .Net library can be found at http://www.codeplex.com/wbxml. I will finalize this library so that it can be used for WBXML message which are used for SyncML.