Build a JavaScript wrapper for a rails-generated XML API?
Posted
by Thor Thurn
on Stack Overflow
See other posts from Stack Overflow
or by Thor Thurn
Published on 2010-04-14T23:37:44Z
Indexed on
2010/04/14
23:43 UTC
Read the original article
Hit count: 305
I am working with a large website written in Ruby on Rails. Thanks to the support for REST in Rails 2, the site's business logic is all accessible via a consistent XML API. Now I want to be able to easily write one or more JavaScript frontends to the site that interact with the generated Rails XML API.
Ideally, an automated wrapper for the API could be created in JavaScript, since this would minimize the effort required in writing XML processing code for the more than 500 API functions. How, then, can I automatically generate a wrapper around a given XML API in JavaScript so that it's more pleasant to work with? I've worked with solutions of this nature for Java that generate classes and methods to wrap an API, so my current thinking is that I want something of that nature for JavaScript. I'd be open to an alternative take on the problem, though.
© Stack Overflow or respective owner