I access 3rd party software through xmlrpc calls.  I built mine as a
plugin... but i'll extract some of it for you in this example below:

require "xmlrpc/client"

def api_perform(class_type, method, *args)
  begin
    server = XMLRPC::Client.new3({'host' => @api_url, 'path' => "/api/
xmlrpc", 'port' => 443, 'use_ssl' => true})
    result = server.call("#{class_type}.#{method}", @api_key, *args)
  rescue XMLRPC::FaultException => e
    puts "*** Error: #{e.faultCode} - #{e.faultString} ***"
  end

  return result
end

The result that's returned is a Hash.

Hope this helps.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to