From 343a0cbd74344d56664a0ff23025e025c3d951fb Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 18 Jun 2012 21:32:50 -0400 Subject: [PATCH] getting familiar with SOAP + Ruby --- ruby-soap/uszip-client.rb | 17 ++ ruby-soap/uszip.wsdl | 395 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 412 insertions(+) create mode 100644 ruby-soap/uszip-client.rb create mode 100644 ruby-soap/uszip.wsdl diff --git a/ruby-soap/uszip-client.rb b/ruby-soap/uszip-client.rb new file mode 100644 index 0000000..3baff0e --- /dev/null +++ b/ruby-soap/uszip-client.rb @@ -0,0 +1,17 @@ +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 diff --git a/ruby-soap/uszip.wsdl b/ruby-soap/uszip.wsdl new file mode 100644 index 0000000..8f644ef --- /dev/null +++ b/ruby-soap/uszip.wsdl @@ -0,0 +1,395 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Get State Code,City,Area Code,Time Zone,Zip Code by Zip Code + + + + + Get State Code,City,Area Code,Time Zone,Zip Code by City + + + + + Get State Code,City,Area Code,Time Zone,Zip Code by state + + + + + Get State Code,City,Area Code,Time Zone,Zip Code by Area Code + + + + + + + Get State Code,City,Area Code,Time Zone,Zip Code by Zip Code + + + + + Get State Code,City,Area Code,Time Zone,Zip Code by City + + + + + Get State Code,City,Area Code,Time Zone,Zip Code by state + + + + + Get State Code,City,Area Code,Time Zone,Zip Code by Area Code + + + + + + + Get State Code,City,Area Code,Time Zone,Zip Code by Zip Code + + + + + Get State Code,City,Area Code,Time Zone,Zip Code by City + + + + + Get State Code,City,Area Code,Time Zone,Zip Code by state + + + + + Get State Code,City,Area Code,Time Zone,Zip Code by Area Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file