Decoding a WBXML SyncML message from an S60 device

老子叫甜甜 提交于 2019-12-03 08:51:21

Funnily enough I've been working on the same problem. I'm about halfway through writing my own pure-Python WBXML parser, but it's not yet complete enough to be useful, and I have very little time to work on it right now.

Those <Unknown> tags might be because pywbxml / libwbxml doesn't have the right tag vocabulary loaded. WBXML represents tags by an index number to avoid transmitting the same tag name hundreds of times, and the table that maps index numbers to tag names has to be supplied separately from the WBXML document itself. From a vague glance at the libwbxml source it seems like libwbxml has a bunch of tag tables hard coded. It has tables for SyncML 1.0-1.2; I think my Nokia E71 sends SyncML 1.3 (if so, your N95 probably does too), which it looks like libwbxml doesn't support yet.

Getting it to work might be as simple as adding a SyncML 1.3 table to libwbxml. That said, last time I tried, pywbxml doesn't compile against the vanilla libwbxml source, so you have to apply some patches first... so "simple" may be a relative term.

I ended up writing a python parser myself. I managed to do it by following the spec here: http://www.w3.org/TR/wbxml/

And then taking the code tables from the horde.org cvs.

The open mobile alliance's site and documentation are terrible, this was a very trying project :(

Engrost

I used pywbxml , Just needed one patch in pywbxml.pyx:

params.lang in function wbxml2xml around line 25 set to:

params.lang = WBXML_LANG_UNKNOWN

works like charm. Also changing base class for WBXMLParseError to exception helps:

class WBXMLParseError(Exception):
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!