Ruby Web Services

Monday, January 28, 2008

Training on Web Services with Ruby

The next online training session done by WSO2 on Ruby Web Services is happening on Thursday 21st of February 2008 from 9.00 am to 12.00 noon (PST). You can reserve your slot at a cost of $199. Visit here for more details.

Thursday, January 24, 2008

Ruby SOAP Driver vs WSF/Ruby SOAP Support

As most of the Ruby SOAP programmers may already know, Ruby has support for SOAP style invocations. But when we compare that with the SOAP support comes with WSF/Ruby, we can clearly see the following differences.

1. Set SOAP Version


In Ruby SOAP you simply can not do this. This is how you do it in WSF/Ruby.

client = WSClient.new({"to" => "some/endpoint",
                       "use_soap" => 1.1,
                       "action" => "some/action"},
                       "some-log-file")


This would set the SOAP version to SOAP1.1. If you do not set the version specifically, then SOAP1.2 is used.

2. Use Complex Payloads

In Ruby SOAP you can not set a complex XML serialized payload when sending messages to a Web service. But in WSF/Ruby this is not a big deal. As  shown below, you have two options when it comes to setting payload.

2.1 Give serialized XML payload when you use WSClient to send/request.

req_payload_string = "some XML serialized payload"

client = WSClient.new({"to" => "some/endpoint"},
                       "some_log_file"
)

res_message = client.request(req_payload_string)


2.2 Set serialized XML payload in the WSMessage object used when send/request using WSClient

req_message = WSMessage.new(req_payload_string,
                            nil,
                            {
"to" => "some/endpoint"})

res_message = client.request(req_message)

Monday, January 7, 2008

The Best Practices of using WSClient

Today I posted a blog in the PHP Webservices blog about the $title (The Best Practices of using WSClient).

In fact this practice can be similarity apply for the Ruby Webservice development as well. If you have already downloaded the WSO2 Webservice Framework for Ruby, you will be able to see how this practice is in use in ruby language as well. Check the samples/consumer/rails/flickr/controllers/flickr_client.rb file in the distribution pack for a reference.

Sunday, January 6, 2008

WSDL Support is Coming Up

WSO2 Web services framework for Ruby already stands out in the Ruby space as the most comprehensive Web services framework, because of the number of WS-* specifications that is supports.

However, one may argue, that WSDL support is something lacking, WSDL being one of the base specifications. Well, the good news is that work on WSDL support is already under way.

Currently contract first model is being attended to. This would allow the users to implement clients and services with a given WSDL.

Next, WSDL generation would be also supported. That is, a WSDL would be generated for a given Ruby script.

WSDL support will take some time, given the complexities of WSDL. I hope that we would have WSDL mode by end of March. WSDL generation would take a bit more time than that. Keep your fingers crossed.

Thursday, January 3, 2008

Where you should start Ruby Webservices with WSO2 WSF/Ruby..

WSO2 WSF/Ruby bundles implementations of wider range of web service specifications like security, policy, reliable messaging and binary attachments. But it is designed to be so simple, so not only experts on web services, but also newbies will also be able to use it without going into much trouble.

If you are a ruby guy, and you are planing to integrate web services in to your project, you will find this product is the one which fulfill your requirements. Because,

1. Initially You may start doing only very simple things with web services (may be you are little excited to depend on web services at first), Still WSO2 WSF/Ruby is ready to deploy and consume your simplest web services.

2. Later on, you will implement most of your business critical applications with web service back-ends, So you will need some more security and reliability in your applications. But if you are on WSO2 WSF/Ruby it is just a matter of adding few options to your code (worse case you may write some configuration files on enforcing security policies) and you are done.

Linux users can tryout building from the source. It is just a matter of installing the dependencies and then editing the 'rbconfig.rb' file in order to give the configuration options and finally running 'build.sh' script.

For windows WSO2 WSF/Ruby provides a binary distribution. You can follow through the guide, and in few steps you are ready to write consumer and provider applications with WSO2 WSF/Ruby.

Wednesday, January 2, 2008

WSO2 Web Services Framework for Ruby 1.0.0 Released

After three months of work, we finally on the release of WSO2 WSF/Ruby 1.0.0. It is the latest member of the WSO2 WSF product family. This enables ruby developers to taste the full spirit of the web services.


Here is the release note for the release:

WSO2 Web Services Framework for Ruby 1.0.0 Released
===================================================

WSO2 WSF/Ruby team is pleased to announce the release of WSO2 WSF/Ruby
1.0.0.

WSF/Ruby is the Ruby language extension to WSO2 WSF/C. This version
enables you to consume/provide Web Services both with REST and with the
power of WS-* stack including WS-Reliable Messaging, WS-Security,
WS-Addressing and MTOM Attachments.

For more information, please visit our project home page,
http://wso2.org/projects/wsf/ruby

You can download this release from:
http://wso2.org/downloads/wsf/ruby


Key Features
------------

1. Client API to consume Web services
* WSMessage class to handle message level options
* WSClient class with both one way and two way service
invocation support
2. Service API to provide Web services
* WSMessage class to handle message level options
* WSService class with support for both one way and two way
operations
3. Attachments with MTOM
* Binary optimized
* Non-optimized (Base64 encoded)
4. WS-Addressing
* Version 1.0
* Submission
5. WS-Security
* UsernameToken and Timestamp
* Encryption
* Signing
* WS-SecurityPolicy based configuration
6. WS-Reliable Messaging
* Single channel two way reliable messaging
7. REST Support
* Expose a single service script both as SOAP and REST service

Major Changes Since Last Release
--------------------------------
1. Support for the following specifications on provider side
* REST
* SOAP MTOM
* WS-Security (with Rampart)
* WS-Policy
* WS-SecurityPolicy

Dependencies
---------------

1. The provider implementation uses Rails framework as the deployment
model. Therefore in order to use provider implementation, you should
have Rails installed on your machine. Please visit
http://www.rubyonrails.org/ to find out more about RoR(Ruby on Rails).

Reporting Problems
-----------------

Issues can be reported using the public JIRA available at:
https://wso2.org/jira/browse/WSFRUBY

Contact Us
----------

Please subscribe to our user or developer mailing lists. For details on
how to subscribe please visit: http://wso2.org/projects/wsf/ruby#mail

Thank you for your interest in WSO2 WSF/Ruby.

- WSO2 WSF/Ruby Team