The folks at WSO2 have created a Ruby binding for their enterprise Web Services stack, WSF/C. WSF/Ruby supports SOAP 1.2 and many WS-* specifications, including WS-Addressing, WS-Security, and WS-Reliable Messaging. Built on Apache Axis2, Rampart, and Sandesha2, it is interoperable with .NET and J2EE SOAP implementations. Now that SOAP has been decoupled from Rails, this has potential as a solid replacement.
I've only scratched the surface so far, but there is documentation, including API docs accompanied by a manual and quick-start guide.
The server is easily integrated with a Rails controller. If you deploy your Rails app, you've deployed the service. A service is also automatically exposed as REST—a REST request receives a REST response.
Sample service-in-a-Rails-controller based on their quick start guide:
def greet(message) responsePayloadString = '<greetResponse>Hello Client!</greetResponse>' return WSO2::WSF::WSMessage.new(responsePayloadString) end class HelloServiceController < ApplicationController require "wsf" def greet operation = "greet" #service operation method = "greet" #ruby method to be invoked service = WSO2::WSF::WSService.new( {"operations" => {operation => method}}) # docs are not clear on what has to be in these arguments render :text => service.reply(request, response) end end
The API seems to be a bit funky, but maybe I'm just not getting it yet. Would be interested to hear if anyone has a chance to try it out.
1 comment so far ↓
did you ever get this installed? if so, can you say how? i found it to be impossible to install.
Leave a Comment