4

I am running Ruby on Rails 3 and I would like to create an application APP1 that acts as a Web Service. Then create another RoR application APP2 that can communicate (send/get information) with APP1 using the OAuth protocol.

What I have to do to start (I am not expert about programming in those topics but I read a lot and I know how they conceptually\theoretically works)? Is it good to think to implement my custom code or maybe it is better to use plugin or gem? Why?

If it is possible, can you write a TODO list and steps to accomplish what I aim?

And, more important, can you suggest me some useful (awesome) resources (like books, blog posts, ...) about creating RoR Web Services?

user502052
  • 14,803
  • 30
  • 109
  • 188

1 Answers1

3

Assuming you get to decide what kind of Web Service you want, and a RESTful XML Web Service is an acceptable choice, then Rails applications practically do this by default. When you generate scaffolding code, your controller will actually be ready to interface with as a RESTful Web Service.

Of course, that's not everything you need to know and do, but the subject seems to be covered very well by the following series of articles...

  1. http://css.dzone.com/news/rest-with-rails-part-1
  2. http://css.dzone.com/news/rest-with-rails-part-2-serving
  3. http://css.dzone.com/news/rest-with-rails-part-iii-using

Unfortunately, there seem to be some JavaScript errors on those pages, but they're still usable.

I know this doesn't answer the OAuth part of your question, but this article ( http://stakeventures.com/articles/2009/07/21/consuming-oauth-intelligently-in-rails ) apears to have some useful information on that subject. Note that the info here is slightly out of date if you'll be using Rails 3 because you'll want to list the gems in your Gemfile and run bundle install rather than adding config.gem ... lines to your environment.rb file.

Steve Jorgensen
  • 11,725
  • 1
  • 33
  • 43
  • I know RESTful XML Web Services, but what about authorizing user to access information in APP1 from APP2 SAFELY? This is because I would like to use OAuth. – user502052 Feb 12 '11 at 19:46
  • We're typing over each other. I don't think you had the OAuth part of your question there when I first typed my answer, and I was adding a response to that when you posted your comment above. – Steve Jorgensen Feb 12 '11 at 19:52
  • 1
    The main problem is how to maintain an user authentication on all Web Services. – user502052 Feb 12 '11 at 19:53
  • "We're typing over each other..." you are right! Sorry for that, but for me it is hard to explain my issues. – user502052 Feb 12 '11 at 19:55