Hello, Has anyone had to write a web service in Rails? If so, I''d love to get some information from you as to where to begin. I have recently started introducing Rails into the enterprise at my office. It has been met with some hesitation by the older developers (all using .NET). Anyway, a requirement came up to write some web services that allow another web company to consume certain information. Basically i need to set up a registration service for members and then a log in service where we can authenticate users... we''ll be storing the credentials on our side. Basically it breaks down like this: Registration other company will pass last 4 of SSN, Zip code, Email Address, Password Our Response Already registered (boolean): true if already registered, false if not if registered the registered email address (string) the registered password (string) other company can then use these to send them a forgot password email Login other company will pass email (string) password (string) Our response allowed (boolean) other information... We''re storing all of our data on SQL Server 2008 but that''s not a big issue. I wanted to be able to show Rails'' capability of quickly and easily handling this standard enterprise requirement. I''d love to hear some thoughts from anyone who has done this type of thing before. I am really trying to avoid using Windows Communication Foundation for this type of thing. I was thinking just a very SOAP type of thing would be the best approach. Thanks! Steve
Hi Steve, On Wed, 2009-11-04 at 06:24 -0800, Steven Elliott Jr wrote:> Has anyone had to write a web service in Rails? If so, I''d love to get > some information from you as to where to begin.<snip>> I was thinking just a very SOAP type of thing would be > the best approach.I''d recommend starting with "RESTful Web Services" by Leonard Richardson and Sam Ruby, published by O''Reilly. Rails today has a very strong preference for REST over SOAP when it comes to Web Services. Having experience with both, I can say without equivocation that REST is the way to go if you can. If you can''t, use the plugin at http://agilewebdevelopment.com/plugins/action_web_services HTH, Bill
Hi Bill, Thanks for the email. Ya I am looking into RESTful now thinking that might be the way to go. There is not too much on the web out there but I saw a book from Apress "Practical Rest On Rails 2" I am thinking of taking a look at that. Thanks again, Steve On Wed, Nov 4, 2009 at 2:09 PM, bill walton <bwalton.im-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi Steve, > > On Wed, 2009-11-04 at 06:24 -0800, Steven Elliott Jr wrote: > > > Has anyone had to write a web service in Rails? If so, I''d love to get > > some information from you as to where to begin. > > <snip> > > > I was thinking just a very SOAP type of thing would be > > the best approach. > > I''d recommend starting with "RESTful Web Services" by Leonard Richardson > and Sam Ruby, published by O''Reilly. > > Rails today has a very strong preference for REST over SOAP when it > comes to Web Services. Having experience with both, I can say without > equivocation that REST is the way to go if you can. If you can''t, use > the plugin at http://agilewebdevelopment.com/plugins/action_web_services > > HTH, > Bill > > > > >-- Steven Elliott Jr --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Bill, isn''t Rails a bit too much for you (little) WS. How about considering another little "frameworks" like Sinatra? It''s worth a try. Rails is a great framework but it''s not always a (the) right choice. Can give you some links if you want. Cheers, Chris
On Wed, Nov 4, 2009 at 3:26 PM, Christoph Jasinski <christoph.jasinski-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Rails is a great > framework but it''s not always a (the) right choice.Please tell me, under what circumstances is Rails not the right choice? Reading your statement made me think of other frameworks I''ve used to build sites with over the years.. Django, Zend Framework, Catalyst, J2EE, .Net. I can''t think of a single thing that''d make me want to use any of those instead of Rails. The only reason I can think of is if maybe you didn''t know Ruby. But then Rails list traffic shows that particular detail doesn''t seem to hold anyone back. -- Greg Donald http://destiney.com/
Hi yes. My original post implied this was a simple web service but it will get incrementally more difficult as we add more services. This is just a starting point. Also my goal is here is to probe to management and the other developers that rails is industrial strength enough for these types of things. I''m still going forward with rails. I just wanted to know if anyone else has done this type if thing before and how they started. -- Steven Elliott Jr On Nov 4, 2009, at 4:50 PM, Greg Donald <gdonald-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On Wed, Nov 4, 2009 at 3:26 PM, Christoph Jasinski > <christoph.jasinski-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> Rails is a great >> framework but it''s not always a (the) right choice. > > Please tell me, under what circumstances is Rails not the right > choice? > > Reading your statement made me think of other frameworks I''ve used to > build sites with over the years.. Django, Zend Framework, Catalyst, > J2EE, .Net. I can''t think of a single thing that''d make me want to > use any of those instead of Rails. > > The only reason I can think of is if maybe you didn''t know Ruby. But > then Rails list traffic shows that particular detail doesn''t seem to > hold anyone back. > > > -- > Greg Donald > http://destiney.com/ > > >
Well Greg, it seemed you get the message wrong. Somehow I should have known that it can get emotional when posting non-rails things on the rails list, which I see not that positive. 1) I only said my opinion - just like anybody else. It wasn''t the only truth out there. Of course you can build anything with rails from single site page (there was at least one post on the list here) to a mega super duper complex site. I just raise the question whether using a light-weightier framework wouldn''t be a better choice. When I go to check my mail box I use my feet not my car (I about a 10m walk). Example should be clear. 2) I never said anything about other programming language. Sinatra is a "tiny brother" of Rails also written in *RUBY*. I PERSONALLY would never want to recommend to anyone anything other than ruby. Even if it''s about SQL! Period. ;) 3) I like Ruby and Rails like anyone who ever saw it. It''s almost like an addiction. 4) Sorry if my post got your angry, for whatever reasons. Cheers, Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Steven, I found two good resource in my library for Web Services: - Ruby in Practice, from Jeremy McAnally, Manning Publication (it''s chapter 5, implementations with REST and SOAP are shown) - Enterprise Recipes with Ruby and Rails, Maik Schmidt, Pragmatic Programmers, (it''s chapter 7 / receips 32-35; with REST, SOAP and WSDL) Both are great resources with code and explanations. Rails is a good choice ;) Chris --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ok awesome. I will be sure to check them out! Thanks for everyone''s help. I''m sure I''ll post back to the group for some more tips but I''m going to spend some time researching and trying things out. I''m sure Sinatra is awesome but i''m so hell bent on rails right now ( and still building confidence ) that I don''t want to switch to anything else right now. After 5 years of .NET development Rails is like a breath of fresh air for me. I''m hoping to get it established into the enterprise where I work and introduce agile methods. -- Steven Elliott Jr On Nov 4, 2009, at 5:18 PM, Christoph Jasinski <christoph.jasinski-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org > wrote:> Hi Steven, > > I found two good resource in my library for Web Services: > > - Ruby in Practice, from Jeremy McAnally, Manning Publication (it''s > chapter 5, implementations with REST and SOAP are shown) > - Enterprise Recipes with Ruby and Rails, Maik Schmidt, Pragmatic > Programmers, (it''s chapter 7 / receips 32-35; with REST, SOAP and > WSDL) > > Both are great resources with code and explanations. > > Rails is a good choice ;) > > Chris > > >
Good that you can breath now better. I understand that myself after years on Java. Good luck with you service. Chris
respond_to do |format| is the awesome. It makes RESTful web services extremely easy to do in rails. On Nov 4, 2:38 pm, Christoph Jasinski <christoph.jasin...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> Good that you can breath now better. I understand that myself after years on > Java. > > Good luck with you service. > > Chris
Awsums. I''ll check it. Thanx! -- Steven Elliott Jr On Nov 4, 2009, at 5:43 PM, sax <sax-c5KP9hz/kbxwMgcQ4+lbG0B+6BGkLq7r@public.gmane.org> wrote:> > respond_to do |format| is the awesome. It makes RESTful web services > extremely easy to do in rails. > > On Nov 4, 2:38 pm, Christoph Jasinski > <christoph.jasin...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> Good that you can breath now better. I understand that myself after >> years on >> Java. >> >> Good luck with you service. >> >> Chris > >
sax wrote:> respond_to do |format| is the awesome. It makes RESTful web services > extremely easy to do in rails.Also check out make_resourceful. It''s generally helpful for Rails apps where anything RESTful is involved.> > On Nov 4, 2:38�pm, Christoph JasinskiBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
Thanks you for the info. I will most certainly check it out. -- Steven Elliott Jr On Nov 4, 2009, at 9:42 PM, Marnen Laibow-Koser <rails-mailing-list@andreas-s.net > wrote:> > sax wrote: >> respond_to do |format| is the awesome. It makes RESTful web services >> extremely easy to do in rails. > > Also check out make_resourceful. It''s generally helpful for Rails > apps > where anything RESTful is involved. > >> >> On Nov 4, 2:38�pm, Christoph Jasinski > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted via http://www.ruby-forum.com/. > > >
Hi Steven, If you are using rails 2.3.x it already create web services for you as default(although its simple), RESTFull approach. In controller you might have seen this line, respond_to do |format| format.html # index.html.erb format.xml { render :xml => @object } end there format.xml { render :xml => @object } means it returns a RESTFull xml file. (or even you can post as xml files) hope this helps, cheers sameera On Nov 4, 7:24 pm, Steven Elliott Jr <steve.elliottjr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello, > > Has anyone had to write a web service in Rails? If so, I''d love to get > some information from you as to where to begin. > > I have recently started introducing Rails into the enterprise at my > office. It has been met with some hesitation by the older developers > (all using .NET). Anyway, a requirement came up to write some web > services that allow another web company to consume certain > information. Basically i need to set up a registration service for > members and then a log in service where we can authenticate users... > we''ll be storing the credentials on our side. > > Basically it breaks down like this: > > Registration > other company will pass last 4 of SSN, > Zip code, > Email Address, > Password > Our Response > Already registered (boolean): true if already registered, false > if not > if registered > the registered email address (string) > the registered password (string) > other company can then use these to send them a forgot > password email > > Login > other company will pass > email (string) > password (string) > Our response > allowed (boolean) > other information... > > We''re storing all of our data on SQL Server 2008 but that''s not a big > issue. I wanted to be able to show Rails'' capability of quickly and > easily handling this standard enterprise requirement. I''d love to hear > some thoughts from anyone who has done this type of thing before. I am > really trying to avoid using Windows Communication Foundation for this > type of thing. I was thinking just a very SOAP type of thing would be > the best approach. > > Thanks! > Steve