Allowing XML-RPC class.methodName (not MethodName)?


#1

I’m trying to replace a legacy XML-RPC server with a Rails app, and all
is going really well, with one exception. I can’t find a way to allow
javaCaseMethods for XML-RPC calls. It seems Rails wants
CapsCaseMethods, ie:

auth.HasPermission # works
auth.hasPermission # nope
auth.has_permission # nope

Is it possible to get the second two working? Snippets of my AuthAPI:

class RpcController < ApplicationController
wsdl_service_name ‘RPC’
web_service_dispatching_mode :layered

 # Send auth.* to AuthService
 web_service :auth, AuthService.new

end

class AuthAPI < ActionWebService::API::Base
api_method :has_permission,
:expects => [:string, :string, :string,
:string],
:returns => [:bool]
end

class AuthService < ActionWebService::Base
def has_permission(user_id, auth_object_key, permission_realm,
permission)
auth_object_id = AuthObject.convert_key_to_id(auth_object_key)
User.has_permission?(user_id, auth_object_id, permission_realm,
permission)
end

Thanks,
Nate


#2

Found the answer here:

http://blogs.thewehners.net/josh/view/250

Apparently need to use “inflect_names false”, and then manually declare
methods with properMixedCase.