0
저는 Rhomobile에서 매우 새로운 사람입니다. Rhoconnect를 사용하여 webservice에 로그인하려면 아무에게도 이것을 구현하는 방법을 알려줄 수 있습니까?Rhoconnect webservice login need
내가 설정 CONTROLER에 함께 시도했다 :
def do_login
if @params['username'] and @params['password']
begin
SyncEngine.login(@params['username'], @params['password'], (url_for :action => :login_callback))
@response['headers']['Wait-Page'] = 'true'
redirect :action => :index
rescue Rho::RhoError => e
@msg = e.message
render :action => :login
end
else
@msg = Rho::RhoError.err_message(Rho::RhoError::ERR_UNATHORIZED) unless @msg && @msg.length > 0
render :action => :login
end
end
경우 SyncEngine.login(@params['username'], @params['password'])
호출 sourecadapter 방법 login
; 내가
def login(username, password)
user_info = {:username => username, :password => password }
response = RestClient.get(@[email protected]['username'][email protected]['password'])
result = RestClient.post(:url => "my-webservice")
@msg=result["body"]
render :action => :index
end
를 호출하고있어 어디에서 시도했다 :
class Application < Rhoconnect::Base
class << self
def authenticate(username,password,session)
result = RestClient.post(:url => "mywebservice")
true # do some interesting authentication here...
end
end
그러나 나는 아무것도 없어 ... PLZ 몇 가지 아이디어 줘; 이 문제를 해결하는 방법