Class: Ap4r::Dispatchers::XmlRpc

Inherits:
Base show all
Defined in:
lib/ap4r/dispatcher.rb

Overview

Dispatches via XML-RPC protocol. Uses XMLRPC library.

The call result is judged as

  • “failure” if the first element of XMLRPC::Client#call2 result is false, and

  • “success” otherwise.

Instance Method Summary collapse

Methods inherited from Base

#call, dispatch_mode, #initialize, #modify_message, #response

Constructor Details

This class inherits a constructor from Ap4r::Dispatchers::Base

Instance Method Details

#invokeObject



304
305
306
307
308
# File 'lib/ap4r/dispatcher.rb', line 304

def invoke
  endpoint = @message[:target_url]
  client = XMLRPC::Client.new2(endpoint)
  @success, @response = client.call2(@message[:target_action], @message.object)
end

#validate_responseObject

Raises:



310
311
312
# File 'lib/ap4r/dispatcher.rb', line 310

def validate_response
  raise @response unless @success
end