WBXML4R: WBXML for Ruby
Posted by tom February 4th, 2007
Today I’ve created my very first Ruby Extension: WBXML4R. It’s a pretty simple extension, but I needed it very badly. It translates WAP Binary XML to XML and back, now if somebody can explain me how to wrap this in a gem I’d appreciate it. It uses wbxml2-0.9.2 available from here. If you want it drop me a mail.
The idea for it’s use is simple: I want to write a small Ruby server which will allow my P990 to sync with it.
I’ve successfully converted from WBXML to XML using:
require 'wbxml4r'
c = WBXML4R::Converter.new
wbxml = IO.read("test.wbxml")
puts c.wbxml2xml(wbxml)
The conversion back is just as simple:
require 'wbxml4r'
c = WBXML4R::Converter.new
xml = IO.read("test.xml")
puts c.xml2wbxml(xml)

March 17th, 2007 at 02:13 AM
Hello,
I am beginning to experiment with Ruby on Rails and am looking at using WbXML for a wireless project. Would you be open to sharing the code for wbxml4r? If I endup using it or enhance your effort (like wrapping it into a gem), will sure to share that with you.
Thanks much.
-Anup
March 19th, 2007 at 10:31 PM
Hi Anup,
Tried mailing you at the address you gave when posting your comment, but it bounced. If you mail me (tom at degrunt dot nl) I will reply back with the source code.
Tom.
March 20th, 2007 at 09:30 PM
Hello
I ve been working with ruby for almost a year now. I am trying to do something like this also , kindly send me ur code so i can use it and i ll keep u updated with the changes i ll do. Although i ve never tried to wrap a code into a gem, but i might give it a try. Thanks a lot.
Regards; Rana Said
April 3rd, 2007 at 09:28 AM
I am using Motorola L6 for sync i have received a WBXML and i have converted from UTF-8 to string and also de-encode the usr/pass into base64. now i need to convert it into xml then parse it and form a answering syncml msg again encode it into wbxml tell me how ruby help me to do this plz help me in this regard
May 31st, 2007 at 05:55 PM
please send me this library if you can. thanks!
July 20th, 2007 at 04:51 PM
Tom,
Any chance I could get the ruby source for wbxml4r?
-Mike
October 12th, 2007 at 09:34 AM
hi tom,
i think you have done a great job which will help lots of people hats off to you buddy,
Any chance I could get the source for wbxml4r ,if you can help me.
please do reply,
November 28th, 2007 at 09:36 PM
I would love to get the source for this. Thanks!