Type:
Class
Constants:
USER_AGENT : "XMLRPC::Client (Ruby #{RUBY_VERSION})"

Provides remote procedure calls to a XML-RPC server.

After setting the connection-parameters with ::new which creates a new XMLRPC::Client instance, you can execute a remote procedure by sending the #call or #call2 message to this new instance.

The given parameters indicate which method to call on the remote-side and of course the parameters for the remote procedure.

require "xmlrpc/client"

server = XMLRPC::Client.new("www.ruby-lang.org", "/RPC2", 80)
begin
  param = server.call("michael.add", 4, 5)
  puts "4 + 5 = #{param}"
rescue XMLRPC::FaultException => e
  puts "Error:"
  puts e.faultCode
  puts e.faultString
end

or

require "xmlrpc/client"

server = XMLRPC::Client.new("www.ruby-lang.org", "/RPC2", 80)
ok, param = server.call2("michael.add", 4, 5)
if ok then
  puts "4 + 5 = #{param}"
else
  puts "Error:"
  puts param.faultCode
  puts param.faultString
end
new
  • References/Ruby on Rails/Ruby/Classes/XMLRPC/XMLRPC::Client/XMLRPC::Client::Proxy

new(server, prefix, args=[], meth=:call, delim=".") Class Public methods Creates

2025-01-10 15:47:30
call2_async
  • References/Ruby on Rails/Ruby/Classes/XMLRPC/XMLRPC::Client

call2_async(method, *args) Instance Public methods Same as

2025-01-10 15:47:30
call2
  • References/Ruby on Rails/Ruby/Classes/XMLRPC/XMLRPC::Client

call2(method, *args) Instance Public methods The difference between this method

2025-01-10 15:47:30
multicall2
  • References/Ruby on Rails/Ruby/Classes/XMLRPC/XMLRPC::Client

multicall2(*methods) Instance Public methods Same as

2025-01-10 15:47:30
password=
  • References/Ruby on Rails/Ruby/Classes/XMLRPC/XMLRPC::Client

password=(new_password) Instance Public methods Changes the password for the

2025-01-10 15:47:30
timeout=
  • References/Ruby on Rails/Ruby/Classes/XMLRPC/XMLRPC::Client

timeout=(new_timeout) Instance Public methods Sets the Net::HTTP#read_timeout

2025-01-10 15:47:30
user=
  • References/Ruby on Rails/Ruby/Classes/XMLRPC/XMLRPC::Client

user=(new_user) Instance Public methods Changes the user for the Basic Authentication

2025-01-10 15:47:30
call
  • References/Ruby on Rails/Ruby/Classes/XMLRPC/XMLRPC::Client

call(method, *args) Instance Public methods Invokes the method named method

2025-01-10 15:47:30
new2
  • References/Ruby on Rails/Ruby/Classes/XMLRPC/XMLRPC::Client

new2(uri, proxy=nil, timeout=nil) Class Public methods Creates an object which

2025-01-10 15:47:30
proxy_async
  • References/Ruby on Rails/Ruby/Classes/XMLRPC/XMLRPC::Client

proxy_async(prefix=nil, *args) Instance Public methods Similar to

2025-01-10 15:47:30