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)

8 Responses to “WBXML4R: WBXML for Ruby”

  1. Anup Says:

    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

  2. Tom de Grunt Says:

    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.

  3. Rana Says:

    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

  4. Raheel Javed Says:

    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

  5. ozonek Says:

    please send me this library if you can. thanks!

  6. Mike Loll Says:

    Tom,

    Any chance I could get the ruby source for wbxml4r?

    -Mike

  7. amit Says:

    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,

  8. Andrew Says:

    I would love to get the source for this. Thanks!

Leave a Reply