WSF/Rubyx hardwired to RAILS

etm's picture
I don't like that wsf/ruby is hardwired to rails (in fact it is even more serious, it is hardwired to Rails::CGIRequest) therefore i wrote a small patch to wsservice/wsf.c to make it more generic: WSService::reply(request_headers, request_body, response) Patch is attached, as always, please include in next version :-) regards, eTM
dimuthuc's picture

Hi eTM, Thats very much for

Hi eTM, Thanks very much for your effort and specially contributing it back to wsf/ruby. Anyway I think the patch is not attached in the forum properly. The best way to submit the patch is create a jira issue. You can access it from here, https://wso2.org/jira/browse/WSFRUBY Thanks Dimuthu
etm's picture

WSF/Rubyx hardwired to RAILS

Hi Dimuthu, sorry that it took me so long to answer, had some stormy days at work :-) I created the jira issue https://wso2.org/jira/browse/WSFRUBY-70, and I also created an example to show how the new invocation should work: * http://www.pri.univie.ac.at/~mangler/wsf/echo/wsf1.wsdl is the well know echo example from the samples directory * http://www.pri.univie.ac.at/~mangler/wsf/echo/wsf1_service.rb is a server which uses rack abstraction, its directly startable ** use gem install rack to add rack to your computer if you not already have it * http://www.pri.univie.ac.at/~mangler/wsf/echo/wsflet.rb is sort of a small rack adapter (provides the glue between the webserver and wsf) Start the server with "ruby wsf1_server.rb", use "ruby wsf1.rb" or "php wsf1.php" to call the server. I can create a Rails example and or change the samples directory to the new format if you like. The new approach has the following advantage: No more hard binding to rails, the C code becomes slightly less complex, the result is more universally usable in all sorts of frameworks. Jürgen
etm's picture

Rails example for the above described api

The Controller for the above mentioned API is presumably the following. Should be correct, haven't tried it out though. class Wsdl11ServiceController < ApplicationController skip_before_filter :verify_authenticity_token def index begin operations = {"QueryPurchaseOrder" => "QueryPurchaseOrderFunction"} wss = WSO2::WSF::WSService.new({"operations" => operations, "wsdl" => "sample_wsdl_11.wsdl"}) status, headers, body = wss.reply(request.env,request.raw_post); response.headers = headers response.status = status render :xml => body end end end
hblink's picture

Has the patch been applied

I am planning to incorporate WSF/Ruby into Yahoo BrowserPlus (http://browserplus.yahoo.com/developer/). For this project to work it requires only "pure ruby libraries". We can then have full WSF functionality on the browser! If any developers would like to participate then please drop me a line.
nandika's picture

Re

Great to here that you are going to incorporate WSF/Ruby to Yahoo BrowserPlus. We would like to help on WSF/Ruby aspect if you run into any issues. Regards Nandika
naveen20030.gmail.com's picture

Nice and thanks for given

Nice and thanks for given information to us. electronic cigarette
cliftonsmiles12.gmail.com's picture

Dental Implants Bristol

I can create a Rails example and or change the samples directory to the new format if you like...Your post is really good and informative.You have done a great job by posting this article. Dental Implants Bristol