Simon Twigger @ MCW

bioinformatics and related stuff

Ruby web services

By Simon • Sep 26th, 2006 • Category: Ruby, Semantic Web & Web Services

My current obession is learning and using the Ruby programming language, both for web appls (using Rails) and in general as an alternative to perl. I did some webservice stuff today and its incredibly easy, you can try this in the irb

require 'soap/wsdlDriver'
wsdl = 'http://www.ebi.ac.uk/Tools/webservices/wsdl/WSDbfetch.wsdl'
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
puts driver.getSupportedDBs()

This three line snippet calls the WSDbfetch service at EBI and gets a list of their supported databases. It returns an array of databases so you can pop them into a variable and iterate over them, etc. All of this can be done using Java and Perl so really there is nothing too new here but you will note that I didnt have to install SOAP::Lite (perl) or AXIS (java), it worked straight out of the box with a standard ruby install. I’m wondering what entertaining things could be created using rails and such easy webservice access to create some cool web tools that harness the increasing number of webservices out there and also the development speed of Rails…

Maybe Im just caught up in the giddy rush of the start of a new (programming) relationship where everything seems wonderful, but perhaps Ruby and Rails might start to replace Perl and similar things as my go-to tools. Or maybe the cold light of day will reveal some as yet overlooked flaws and I’ll have to go crawling back to my old love, begging for forgiveness - we’ll see!

Simon is
Email this author | All posts by Simon

Leave a Reply