This deals with the Rails book, but ActionWebService in general. I''m having trouble getting the Rails book''s example in the Web Service chapter working. Everything else works (all the ''depot'' site features up to that point have been built and work). I don''t think it''s an issue with the book code being wrong, because the ActionWebService API docs show almost the same example. Since ActionWebService is not heavily documented and not widely used (outside of Typo) I can''t quite figure it out. When calling: http://depot/backend/invoke My error is: <code> Errno::ENOENT in Backend#invoke No such file or directory - /D:/Projects/Ruby/depot/public/D:/apps/ruby/lib/ruby/gems/1.8/gems/actionwebservice-0.7.1.1337/lib/action_web_service/templates/scaffolds/methods.rhtml </code> This is because of the "web_service_scaffold :invoke" line, as seen below. I''ve also tried this by using an earlier gem version of rails (0.12.1, instead of the current 0.12.1.1337 beta gem) <code> # app/api/product_api.rb class ProductApi < ActionWebService::API::Base api_method :find_all_products, :returns => [[:int]] api_method :find_product_by_id, :expects => [:int], :returns => [Product] end # app/controllers/backend_controller.rb class BackendController < ApplicationController wsdl_service_name ''Backend'' web_service_api ProductApi web_service_scaffold :invoke def find_all_products Product.find(:all).map {|product| product.id} end def find_product_by_id(id) Product.find(id) end end </code> Am I missing something (besides ''missing'' something)? Curiously this section of the book is the one part that has escaped an avalanche of corrections/suggestions in the errata page. Thanks in advance. Matt
On 5/31/05, Matt Pelletier <pelletierm-A1PILTyJ15gXhy9q4Lf3Ug@public.gmane.org> wrote:> When calling: > http://depot/backend/invoke > > My error is: > <code> > Errno::ENOENT in Backend#invoke > No such file or directory - > /D:/Projects/Ruby/depot/public/D:/apps/ruby/lib/ruby/gems/1.8/gems/actionwebservice-0.7.1.1337/lib/action_web_service/templates/scaffolds/methods.rhtml > </code>This is curious. In a gem built locally, I have that file in the gems directory. Perhaps something on the system the beta gems are being built on excludes those files from the beta gem, I''ll need to investigate. Thanks for the report.> Am I missing something (besides ''missing'' something)? Curiously this > section of the book is the one part that has escaped an avalanche of > corrections/suggestions in the errata page.Yeah, unfortunately AWS is not exactly the most sexy of projects ;) Thanks, Leon
leon breedt wrote:> On 5/31/05, Matt Pelletier <pelletierm-A1PILTyJ15gXhy9q4Lf3Ug@public.gmane.org> wrote: > >>When calling: >>http://depot/backend/invoke >> >>My error is: >><code> >>Errno::ENOENT in Backend#invoke >>No such file or directory - >>/D:/Projects/Ruby/depot/public/D:/apps/ruby/lib/ruby/gems/1.8/gems/actionwebservice-0.7.1.1337/lib/action_web_service/templates/scaffolds/methods.rhtml >></code> > > This is curious. In a gem built locally, I have that file in the gems directory. > Perhaps something on the system the beta gems are being built on > excludes those files from the beta gem, I''ll need to investigate. > Thanks for the report. >Well, the odd thing is, those files are definitely in there: ~/actionwebservice/lib/action_web_service/templates/scaffolds methods.rhtml layout.rhtml parameters.rhtml result.rhtml They are in the respective directory of every Rails version I have used (gems 0.12.1 and up, AND now even the Rails project''s local /vendor/rails), and all yield the same result. Fortunately it''s a moot point for the moment, as I managed to find the AWS manual (http://manuals.rubyonrails.com/read/chapter/68), and stumbled across the Rails trunk''s AWS examples (GoogleSearch), the combination of which has helped pull me out of the muck. I still cannot call the invoke action, but at least I can call /controllername/wsdl and get a response. Phew! For my next trick, I''ll be building out my rails app to interact directly with my .NET backend via web services. Initially I''ll have my .NET app call Rails AWS, but after that I''d like Rails to consume my .NET-generated WS (should I even hold my breath?). I''ll see how it goes... --Matt> >>Am I missing something (besides ''missing'' something)? Curiously this >>section of the book is the one part that has escaped an avalanche of >>corrections/suggestions in the errata page. > > Yeah, unfortunately AWS is not exactly the most sexy of projects ;) > > Thanks, > Leon > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails > >