About Ruby

Since there has been so much hype about ruby, I thought I'd better take a look at it.

I must say it looks really good. There's two things i like about Ruby:

  1. Duck-typing

So many times I have been trying to make generic functionality for classes I didn't own. So in C# I have no chance of implementing a common interface.

With Duck-typing that is now possible, since I find that common functionality and do Duck-typing.

  1. SOAP communication

WOAW, that was sure easy, I implemented a small serice in WCF and tried consuming it in Ruby - 20 secs. and it was done.

require 'soap/wsdlDriver'
require 'cgi'

WSDL_URL = http://localhost:8000/?wsdl
soap_client =     SOAP::WSDLDriverFactory.new(WSDL_URL).create_rpc_driver

# Log SOAP request and response
soap_client.wiredump_file_base = “soap-log.txt”

# Call reset method.
result = soap_client.Test(“klaus”)
puts result.inspect

# Call stopGenerate method.
#result = soap_client.stopGenerate('1')
puts result.inspect
comments powered by Disqus