- 1_8_6_287
- 1_8_7_72
- 1_8_7_330
- 1_9_1_378
- 1_9_2_180
- 1_9_3_125 (0)
- 1_9_3_392 (0)
- 2_1_10 (38)
- 2_2_9 (0)
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
Provides remote procedure calls to a XML-RPC server.
After setting the connection-parameters with XMLRPC::Client.new which creates a new XMLRPC::Client instance, you can execute a remote procedure by sending the XMLRPC::Client#call or XMLRPC::Client#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
Constants
USER_AGENT = "XMLRPC::Client (Ruby #{RUBY_VERSION})"
Attributes
[R] | password |
Return the corresponding attributes. |
[R] | user |
Return the corresponding attributes. |
[R] | timeout |
Return the corresponding attributes. |
[RW] | cookie |
Get and set the HTTP Cookie header. |
[R] | http_last_response |
Returns the Net::HTTPResponse object of the last RPC. |
[RW] | http_header_extra |
Add additional HTTP headers to the request |
[R] | http |
Returns the Net::HTTP object for the client. If you want to change HTTP client options except header, cookie, timeout, user and password, use Net::HTTP directly. Since 2.1.0. |