box-o-sand/RubyFun/cookbook/016/03.rb
Dan Buch 0a9428093c Add 'RubyFun/' from commit 'b01c6826131196ba58b5288a3182f2526c89c249'
git-subtree-dir: RubyFun
git-subtree-mainline: a04a502787
git-subtree-split: b01c682613
2013-01-09 23:50:14 -05:00

13 lines
273 B
Ruby

require 'xmlrpc/client'
server = XMLRPC::Client.new2('http://betty.userland.com/RPC2')
puts server.call('examples.getStateName', 5)
begin
server.call('noSuchMethod')
rescue XMLRPC::FaultException => e
puts "Error: fault code #{e.faultCode}"
puts e.faultString
end