# Using Ruby's soap4r v1.5.7 WSDL driver to call a # Microsoft C# SOAP web service # # This example calls a method that takes no parameters. # # Copyright (C) 2007 Harbor Mist, LLC # # This program is copyrighted free software by Pat Palmer, # owner of Harbor Mist, LLC. You can redistribute it # and/or modify it under the same terms of Ruby's license; # either the dual license version in 2003, or any later version. class GetAllSiteNames require 'soap/wsdlDriver' puts "calling RSSService.GetAllSiteNames()" puts " " # ---------- create the web service proxy object ---------- wsdl_url = "http://harbormist.com/rss_service/RSSService.asmx?WSDL" #suppress printout of non-fatal warnings by the library $old_stderr = $stderr; $stderr = StringIO.new factory = SOAP::WSDLDriverFactory.new(wsdl_url) #restore the ability to see errors and warning by the library $stderr = $old_stderr driver = factory.create_rpc_driver # the following line for troubleshooting if needed # driver.wiredump_dev = STDERR # ---------- call the web service method ---------------- results = driver.getAllSiteNames(nil) # ---------- print out result ---------------- count = 0 results.getAllSiteNamesResult.string.each { |item| count = count + 1 puts item } puts " " puts "%s items found" % count end