I'm contemplating creating a web application using a Ruby on Rails/MySQL stack and I am wondering what capabilities are available around web services and SOAP. Is there a capability within the framework or does it require an extension and if so what?
Rails opted for REST over SOAP:
It’ll probably come as no surprise
that Rails has picked a side in the
SOAP vs REST debate. Unless you
absolutely have to use SOAP for
integration purposes, we strongly
discourage you from doing so. As a
naturally extension of that, we’ve
pulled ActionWebService from the
default bundle. It’s only a gem
install actionwebservice away, but it
sends an important message none the
less.
Still, if you must use SOAP, there's always soap4r, but it only supports SOAP 1.1. A better option might be WSF/Ruby. Mark Thomas has an example controller to help you get up and running.
Rails has opted for REST over SOAP in the default framework. It's not hard to go the SOAP route if you want to, though.
I don't recommend soap4r - as of a few months ago, anyway, it wasn't production quality. The updated version of ActionWebService has worked much better for me.
The old way in Rails was to use the Action Web Service framework. The preferred way now is to use the ActiveResource framework for RESTful web services.
Related
I am trying to see if I can create a simple website, like a blog, using only Ruby. No Rails or a database or outside web servers. I plan to store the data in a file for persistence.
I wanted to use TCPServer, CGI, and Net::HTTP.
Is there an easier way I can use?
There are a lot of moving parts when designing a website.
Depending on the purpose of the exercise, you might want to consider using a very simple web framework like Camping, Sinatra, or Ramaze. This is probably the best solution if you're trying to get a top level understanding of web programming because it only has exactly what you need (Camping is less than 4k!) and handles stuff like routing.
Building a web server is more an exercise in HTTP parsing. You might want to omit the framework and try to build something on top of Rake (an API for lots of popular web servers) and a simple web server like Webrick or Thin.
You could also try Espresso
It is easy to learn and fast to run.
And offers all the liberty you need for creation process.
Also it has no hidden "fees", everything is transparent.
Are there any web frameworks on top of EventMachine? So far, I've found Fastr and Cramp. Both seem to be outdated.
Moreover, Googling how to setup Rails + EventMachine, returns a limited amount of results.
NodeJS is really nothing new. Evented I/O has been around for a very long time (Twisted for Python and EventMachine for Ruby). However, what attracts me to NodeJS, is the implementations that are built on top of it.
For example. NodeJS has TowerJS. Among plenty others. Perhaps, this is one of the many contributing reasons to its trending factor.
What I like most about TowerJS, is its Rails-like structure. Is there anything like it for EventMachine?
Goliath is an open source version of the non-blocking (asynchronous) Ruby web server framework.
You may find async sinatra interesting
Besides EventMachine and the others mentioned here, there's vert.x. I'm not sure how much of a "web framework" it is, but its site shows examples for a simple app like one might write in Sinatra.
We're starting development of the new game project using Ruby. We decided to use one of the asynchronous Ruby servers, but we cannot decide which one to choose. Options are:
Goliath
Cramp + thin/rainbows
rack-fiber_pool + rack + thin/rainbows
eventmachine_httpserver
All of them seem to be working with HTTP requests. Cramp also supports Websockets and Server-Side events from the box.
Do you know any pros & cons of these servers?
I've used eventmachine_httpserver to expose a RESTful API in an EventMachine-based IRC bot and would definitely not recommend it for anything serious. It seems more like a minimal proof-of-concept than a serious web server, perhaps best illustrated by the parse_headers hack I had to use.
You may also want to look pub/sub services like nats.
Which set of libraries and tools would you recommend to use for development SOAP-service on Ruby 1.9 - soap-tools, web-servers, or maybe a web-framework?
I have researched this myself. As far as I can tell, there is just one current implementation:
wash_out
It is a very nice to do SOAP in Rails. It does the most basic stuff but it isn't a complete SOAP implementation. I think you are in for a world of hurt if you are building a SOAP service on Rails.
Soap Ui is a pretty good way to test/debug/etc.
Good luck!
Take a look at http://aws.rubyonrails.org/, when it's explained how to create web services within RubyOnRails.
SOAP doesn't seem to be popular in Ruby land. The only library for creating services I know of is SOAP4R (which comes bundled with Ruby), and the documentation for it isn't very detailed.
Anyone used Ruby or Rails to integrate with Exact Target's API or have a good example of using WSSE with SOAP4r?
http://github.com/sbraford/rbet
I've recently released an open source Ruby on Rails web service library that ties into the ExactTarget SOAP API. It covers most of the major objects and methods, with less used usages being rolled out in subsequent releases.
I hope this helps:
http://bit.ly/a6uOZy