How to create SOAP api webserices in rails3.1 - ruby-on-rails

I want to know whether it is possible to create SOAP APIs in RAILS. I googled and found that SAVON can be used for communicating with SOAP API, is their anyway to create soap apis in rails 3.

We've just released 0.3.2 of https://github.com/roundlake/wash_out with new tiny features. It's currently active and maintained (unlike ActionWebService). And is probably best way to do what you want.
However even being maintainer of such a gem I do not recommend you to use SOAP at all. WashOut was created for the cases where you have no choice. So please think twice. In most cases REST is much more preferable.

There's a gem called actionwebservice that served this purpose many years ago. There are a few people who have maintained it along the way, but you might have to dig around. Searching ruby gems.org brings up a few results but it seems like even these are not really maintained. You might want to check out some of the forks too and see if they are still being maintained.
Having said that, if you have the option to not use SOAP, don't. Use REST as support for it is built into Rails and likely isn't going away any time soon.

Check this gem - https://github.com/roundlake/wash_out

Related

Using Photobucket api with Ruby on Rails

I am trying to use Photobucket(API) as a image uploading option in my website.
Is there any available gem to do this? or should i use things like REST to achieve this?
Please suggest.
Thanks,
Balan
The only thing I really found was this https://bitbucket.org/photobucket/api-ruby/src/7b69e473fb9fd5b4d37e2ad7f266500e45ef524b/example.rb?at=default. They are using the oauth rubygem to talk to photobucket, still a lot of manual process involved. It is also still using REST.
I would say the easiest way it going ahead and using REST following http://pic.photobucket.com/dev_help/WebHelpPublic/PhotobucketPublicHelp.htm and http://pic.photobucket.com/dev_help/WebHelpPublic/Content/FAQ/FAQOverview.htm to get you started.
I haven't done a REST client in ruby but this gem looks pretty good https://github.com/rest-client/rest-client.
I would recommend, assuming you have the time, making a photobucket ruby gem and wrapping the REST calls in useful class abstractions. It is great for the community, forces you to follow good practices(to a certain extent) and will provide great experience to put on a resume/talk about in an interview.

I want to build a chat room using Rails, should I use juggernaut 2 or cramp?

Originally I planned to use Juggernaut, however, it is not compatible with Rails 3. And new Juggernaut 2 seems to be completely independent from Rails, which is not what I want. Then I found cramp, it looks quite neat, but is still under development. So I am just wondering which framework should I use? Or is there a better one?
Thanks!
You're right that the new Juggernaut is de-coupled from Rails, but that doesn't mean you can't use the two together. Juggernaut comes with a Ruby library. Using Juggernaut solves the long-lived connection problem that Toby was talking about.
Any questions about Juggernaut, ping me a line (I'm the creator).
I have looked at the options for this stuff quite extensively and real-time chat is a bit against the grain of Rails. If you really want to stay inside Rails, then Cramp is probably the best option. I recommend you have a look at this article on Websockets and Rails as well: http://www.igvita.com/2009/12/22/ruby-websockets-tcp-for-the-browser/
Using EventMachine to handle the communication means you are that even though you will still be outside Rails, you are at least in Ruby and can share models and libraries.
I have a Async Rails build on GitHub:
https://github.com/tobyhede/AsyncRails
Which is largely based on:
https://github.com/igrigorik/async-rails
Well - you could also try Socky: https://github.com/socky/socky-server-ruby
It's ruby-based, and uses WebSocket as base with flash fallback to support most devices. Also it's complete ruby-based so give it a try if you want :)

Getting started consuming web services in a Ruby on Rails 3 application

So I'm getting started learning Rails. Now that Rails 3 is out, I want to stick to learning the Rails 3 way of doing things. One of the things I want to learn how to do is how to consume web services / work with third party REST APIs / create "mashup" applications. I've only done minimal work like this with PHP and pre-built libraries.
Can someone please lead me to some resources, best practices, or give me a quick 101 lesson on how to start working with these types of APIs? What gems should I use? Some sample code to get me started would be much appreciated.
Update: I am specifically trying to use the Google Books API (non-authenticated). Since there is no client library for this API, I'm wondering how other Ruby/Rails developers are working with APIs that don't come with their own Ruby library. That's why I'm looking for a more generic solution to working with "fill in the blank" API.
Update: After some research, I noticed the Net::HTTP library. All the tutorials that talked about it were fairly old. Is this still the best library to use for consuming RESTful web services? Or is there a newer Gem that makes this easier? I just want to know which gem/library I should use, and how to work with the XML/JSON result that is returned.
Update: This presentation was really helpful. It mentions a bunch of different libraries and shows examples of some of the libraries mentioned below: http://www.slideshare.net/pengwynn/json-and-the-apinauts
I'm a pretty big fan of HTTParty.
It's an abstraction layer on top of Net::HTTP with a nice little DSL for consuming web services. Here's a good example of how easy it is to use.
It's not without some warts (lots of dependencies) but it's really the way to go if you're on the consuming side.
I'd recommend REST with Nokogiri:
http://railscasts.com/episodes/190-screen-scraping-with-nokogiri
Nokogiri works well with xml too, not just HTML.
Weary is a really neat DSL for consuming RESTful services.
Clearly inspired by HTTParty but a bit newer and a bit more concise.

Recommended twitter gem for ruby-on-rails

I've found a couple of different twitter gem (for ruby-on-rails) out there:
http://twitter4r.rubyforge.org/
http://twitter.rubyforge.org/
But I'm wondering if someone can rate them and provide a recommendation of either one or a new one.
Thanks
Use twitter. It's actively maintained.
I've used both twitter4r and twitter (outside of Rails though) and over time seem to have stuck with the latter since I find it easy to use and well documented.
Grackle http://github.com/hayesdavis/grackle is pretty good. It's very clean, actively developed and well documented. It supports both Basic and OAuth authentication.

Which CouchDB API to use for Rails?

I am currently investigating possible applications of CouchDB on my current project (written in Rails) and would like to get some feedback from people who have actually used these APIs. Which would you recommend and why?
ActiveCouch
CouchFoo
CouchRest
CouchRest-Rails
CouchPotato
The basic layer of CouchRest is probably the best to get started, CouchPotato is the most active for Rails integration, SimplyStored adds some nicities on top of CouchPotato
With Rails 3 use (or at least seriously consider using) CouchRest Model. It appears to be well maintained, since as of this update on 2013/12/19 I see several changes that are only 2 weeks old.
Before considering SimplyStored, you should note that they give this warning on Github:
Development work as stopped as we don't use SimplyStored anymore. Please do not expect any future commits and fixes.
Perhaps someone will pick it up, as it looks very useful.
I am going through the same process. You might find SimplyStored interesting if you haven't already given it a look.
http://github.com/peritor/simply_stored

Resources