web services

Subscribe to web services 2 post(s), 2 voice(s)

 
Avatar phantom 1 post

hi there,

i need to implement web services in my rails 2.0.2 app for external apps to consume. whilst i’d prefer to do things the REST way, i’m struggling to work out what i need to supply (a la WSDL) to the other apps so that they know the structure of the request that they must send me.
i have looked at activeresource, but that appears to be more appropriate when i’ve got a rails app to consume web services; it’s likely that the external apps i need to respond to won’t be written in rails.
unless i can sort this problem out, i imagine i’ll need to go back to activewebservice. so, am i missing something blindingly obvious here, or is this something that people simply haven’t needed to do in rails ?

thanks,

phantom

 
Avatar EldonAlameda Administrator 196 post(s)

Phantom,

The ideal of the REST interface is more that it supports a common set of conventions. So there’s no need to provide a WSDL to the clients. It’s just a few standard HTTP calls and processing of XML.

Using ActiveResource makes it a seemingly painless process for for Ruby clients – but that doesn’t mean that other languages can’t interface to it.

In fact, if you’re looking for some examples of interfacing to a RESTful Rails application from other languages – a good book to look at would be Ben Scofields Practical REST on Rails projects book. In the book, he creates a fairly simple (scaffolded) Rails application and then spends the rest of the chapters showing different ways to interface to it via REST (i.e. from a javascript widget, from a PHP (squidoo i think), facebook, etc, etc.