Hi everyone. Glad to be back on Rails.... Haven''t been here in a
while. Amazing how much it has evolved.
I''m having a big problem making two applications interact using AWS.
For the purpose of this discussion, lets say the service "provider"
exists on example.com/api/ (so the app folder is in example.com/api/
app/)
First, the code for the service "provider":
app/apis/operator_api.rb
=====================================class OperatorApi <
ActionWebService::API::Base
api_method :find_by_id, :expects => [{:id=>:string}], :returns
=> [Operator]
api_method :find_by_code, :expects =>
[{:code=>:string}], :returns => [Operator]
api_method :find_by_private_name, :expects =>
[{:private_name=>:string}], :returns => [Operator]
api_method :find_all, :returns => [[Operator]]
end
=====================================
app/controllers/operator_controller.rb
=====================================class OperatorController <
ApplicationController
wsdl_service_name ''Operator''
web_service_api OperatorApi
#web_service_scaffold :invoke
def find_by_id
return Operator.find_by_id(params[:id])
end
def find_by_code
return Operator.find_by_code(params[:code])
end
def find_by_private_name
return Operator.find_by_private_name(params[:private_name])
end
def find_all
Operator.find(:all)
end
end
=====================================
If I try to access it directly, it works fine (using invokation). But
when I try to use the client from another application I can''t make it
work. Here''s the code for the client app:
app/controllers/service_controller.rb
=====================================class ServiceController <
ApplicationController
web_client_api :operator, :soap, "http://www1.dirtyhippo.com:
8080/operator"
def operators
@operators = operator.find_all.map do |id|
operator.find_by_id(id)
end
end
def operator
end
end
=====================================
When I go to http://0.0.0.0:3000/service/operator/ I get:
http://0.0.0.0:3000/service/operator/
=====================================MissingSourceFile in <controller not
set>#<action not set>
Missing API definition file in apis/operator_api.rb
app/controllers/service_controller.rb:2
routing.rb:219:in `traverse_to_controller''
generated/routing/recognition.rb:3:in `eval''
generated/routing/recognition.rb:3:in `recognize_path''
script/server:48
Show framework trace
This error occured while loading the following files:
./script/../config/../app/controllers/service_controller.rb
operator_api.rb
Request
Parameters: None
Show session dump
Response
Headers: {"cookie"=>[],
"Cache-Control"=>"no-cache"}
=====================================
Does anyone have any ideas as to what could be wrong? I''m pulling my
hairs out after a week of trying and reading everything I could find.
I even bought the Agile Dev book.
Thank you,
Luis Gómez
_______________________________________________
Rails mailing list
Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
http://lists.rubyonrails.org/mailman/listinfo/rails