#!/usr/bin/env ruby # This code comes from http://ruby-it.org/pages/Client+SOAP # Check the page for copyright notice and explanations require 'soap/rpc/driver' server = "http://services.xmethods.com/soap" namespace = "urn:xmethods-delayed-quotes" client = SOAP::RPC::Driver.new( server, namespace ) client.add_method( "getQuote", "symbol" ) azioni = ["RHAT", "IBM", "MSFT", "AMR", "LNUX", "NT", "TSG"] puts "Prezzi Azioni" puts "================" azioni.sort.each do |azione| printf("%6s %8.3f\n", azione, client.getQuote(azione)) end Prezzi Azioni ================ AMR 15.360 IBM 96.250 LNUX 3.748 MSFT 26.460 NT 7.660 RHAT 18.490 TSG 22.500 require 'soap/rpc/driver' # "Endpoint URL" server = "http://www.ebob42.com/cgi-bin/Romulan.exe/soap/IRoman" # "Method Namespace URI" namespace = "urn:Roman-IRoman" client = SOAP::RPC::Driver.new(server, namespace) # "Method Name" client.add_method("IntToRoman", "int") puts client.IntToRoman(19)