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
On 10/4/05, Luis Gómez <lgomez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m having a big problem making two applications interact using AWS.Hi Luis, Does your "client" application have the same operator_api.rb in app/apis? Regards, Leon
Nope. Does it need to? On Oct 4, 2005, at 8:57 PM, leon breedt wrote:> On 10/4/05, Luis Gómez <lgomez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I''m having a big problem making two applications interact using AWS. >> > > Hi Luis, > > Does your "client" application have the same operator_api.rb in app/ > apis? > > Regards, > Leon > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
So does every client (done in rails) need to have the internal configuration of the service it is consuming? On Oct 4, 2005, at 8:57 PM, leon breedt wrote:> On 10/4/05, Luis Gómez <lgomez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I''m having a big problem making two applications interact using AWS. >> > > Hi Luis, > > Does your "client" application have the same operator_api.rb in app/ > apis? > > Regards, > Leon > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
I just tried it and got the following: //////////////////CODE////////////////////////// NameError in <controller not set>#<action not set> uninitialized constant Operator /app/apis/operator_api.rb:2 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 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:186:in `const_missing'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:193:in `load'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:193:in `load'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:38:in `require_or_load'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:21:in `depend_on'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:171:in `require_dependency'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:171:in `require_dependency'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-0.8.1/lib/ action_web_service/container/action_controller_container.rb:64:in `require_web_service_api'' /usr/local/lib/ruby/gems/1.8/gems/actionwebservice-0.8.1/lib/ action_web_service/container/action_controller_container.rb:36:in `web_client_api'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:193:in `load'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:193:in `load'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:38:in `require_or_load'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:21:in `depend_on'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:171:in `require_dependency'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:171:in `require_dependency'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:127:in `load_file!'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:96:in `const_load!'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:79:in `each'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:79:in `const_load!'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:71:in `const_missing'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/routing.rb:219:in `traverse_to_controller'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/ action_controller/routing.rb:433:in `recognize!'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.1/lib/dispatcher.rb: 32:in `dispatch'' /Users/lgomez/Clients/sobemobile/api_user/public/dispatch.rb:10 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:193:in `load'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.1.1/lib/ active_support/dependencies.rb:193:in `load'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.1/lib/webrick_server.rb: 83:in `handle_dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.1/lib/webrick_server.rb: 35:in `do_GET'' /usr/local/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `__send__'' /usr/local/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' /usr/local/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:94:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:89:in `each'' /usr/local/lib/ruby/1.8/webrick/server.rb:89:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:79:in `start'' /usr/local/lib/ruby/gems/1.8/gems/rails-0.10.1/lib/webrick_server.rb: 21:in `dispatch'' This error occured while loading the following files: ./script/../config/../app/controllers/service_controller.rb operator_api.rb operator.rb Request Parameters: None Show session dump --- {} Response Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} ////////////////CODE///////////////// On Oct 4, 2005, at 8:57 PM, leon breedt wrote:> On 10/4/05, Luis Gómez <lgomez-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> I''m having a big problem making two applications interact using AWS. >> > > Hi Luis, > > Does your "client" application have the same operator_api.rb in app/ > apis? > > Regards, > Leon > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails