Friday, February 02, 2007

Ruby : WebService - GetQuote

require 'soap/wsdlDriver'

wsdl = "http://www.webservicex.net/stockquote.asmx?wsdl"

params = {:symbol => "IBM"}

drv = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
drv.wiredump_dev = STDOUT if $DEBUG
result = drv.GetQuote(params)

puts "\n\nGetQuote : "+result.inspect+"\n\n"

if (result != nil)

 puts "\n\Result.getQuoteResult.methods : "+result.getQuoteResult.methods.sort.join("\n").to_s+"\n\n"
#   puts "Symbol : "+result.getQuoteResult.stockQuotes.Stock.Symbol

end

1 comment:

Anonymous said...

this is test comment