WebServices & controllers

Hi,

I am having problems with REST web-service support.

I have a simple controller:

class DocumentsController < ApplicationController
wsdl_service_name ‘Documents’
web_service_api DocumentsApi
web_service_scaffold :invoke

def list
@docs = Document.find(:all)
respond_to do |wants|
wants.html
wants.xml { return @docs .to_xml }
end
end
end

Then, my api is defined as follow:
class DocumentsApi < ActionWebService::API::Base
api_method :list, :returns => [:string]
end

But when running invoke web interface (same if real client), I got the
following:
Template is missing
Missing template
./script/…/config/…/app/views/contents/invoke_submit.rhtml

What do I miss here?

Thanks you
Jean-Etienne

I forgot this: if I modify the controller code to:
def list
@docs = Document.find(:all)
return @docs.to_xml
end

It works fine like that (but of course this is not suitable)

On 9/11/06, Jean-Etienne D. [email protected]
wrote:

web_service_scaffold :invoke
Then, my api is defined as follow:
What do I miss here?

You are trying to mix AWS with REST API. If you really need them to
coexists, you shouldn’t use direct dispatching mode. See
http://manuals.rubyonrails.com/read/book/10


Kent

In fact, I was just following
http://jamis.jamisbuck.org/articles/2006/03/27/web-services-rails-style

But, I do not see how to call a controller from an AWS controller. Or
did I miss something?

Jean-Etienne

Kent,

Thank you. But changing the dispatching mode won’t help that much on
keeping things DRY. Could you explain me? Or point to some resources?

Thank you

Really anybody??