Hello all!
I trying to create XMLRPC service with ActionWebService plugin and Rails 2.0.2. I use conventional layered based API.
This is my controller: class RpcController < ApplicationController skip_before_filter :verify_authenticity_token web_service_dispatching_mode :layered web_service :user, UserRpcService.new end
And service: class UserRpcService < ActionWebService::Base web_service_api UserRpcAPI def auth(login, passwd) user = User::find(:first, :conditions => {:login => login, :passwd => passwd}) raise UserAuthException, "Auth failed" unless user.instance_of? (User) true end end
In method UserRpcService.auth i need to know from which remote IP this RPC call is come (for logging or restrictions etc.).