Assuming Rails 3:
There are two or three basic approaches to providing XMLRPC services from a rails application.
- Rack (gem 'rack-rpc' - https://github.com/datagraph/rack-rpc), , , , , , ActiveRecord. rack-rpc xml-rpc, application.rb, , ActiveRecord.
, rails 1.x days. , Rails 3.0.5:
gem 'rubyjedi-soap4r'
gem 'actionwebservice', :git => 'https://github.com/mkoentopf/actionwebservice.git'
actionwebservice , API RESTful -, , , xmlrpc (, , ), , , .
, ApiController :
class ApiController < ApplicationController
acts_as_web_service
web_service_dispatching_mode :layered
skip_before_filter :your_default_auth_method
web_service :metaWeblog, MetaweblogService.new(self)
web_service :blogger, BloggerService.new(self)
...
def xmlrpc
api
end
def api
dispatch_web_service_request
end
end
Api Service. ( , "metaWeblog.methname" "metaWeblog.methodname" xml-rpc, , actionwebservice.
MyApi ActionWebService:: API:: Base , api_method, xml-rpc. MyService ActionWebService:: Base , . , / ApiController, , .