box-o-sand/ruby-soap/uszip-client.rb

18 lines
357 B
Ruby
Raw Normal View History

2012-06-19 01:32:50 +00:00
require 'savon'
require 'pp'
WSDL = File.expand_path('./uszip.wsdl', File.dirname(__FILE__))
def main
#client = Savon.client('http://www.webservicex.net/uszip.asmx?WSDL')
client = Savon.client(WSDL)
response = client.request(:tns, :get_info_by_zip) do
soap.body = {"USZip" => 15220}
end
pp response.to_hash
end
if $0 == __FILE__
main
end