Forum: Ruby on Rails Creating a web service with AWS

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ben M. (Guest)
on 2006-01-31 18:39
(Received via mailing list)
So I've read the Action Web Service bit of the documentation for a
while, searched around and asked on the IRQ channel and I just can't
seem to get a simple Hello World type web service up and running with
AWS on Rails.

I have a file called hello_person_api.rb which looks like this:

class HelloPersonAPI < ActionWebService::API::Base
  api_method :HelloName, :expects =>[:string], :returns => [:string]
end

I have put that in the /app/apis/ directory. I also have a file named
hello_person.rb which contains this:

class HelloPerson < ApplicationController

  def HelloName( name )
    return "Hello "+name;
  end
end

I have put that in the /app/controllers/ directory.

As far as I can understand it, that ought to do something (although I
have no idea what path things are supposed to be on so they could be
in the wrong place) but when ask it to do anything I get this:

http://localhost:3000/HelloPerson

Routing Error

No route for path: "HelloPerson"

Failure reasons:
<ActionController::Routing::Route ":controller/service.wsdl" when
{:action=>"wsdl"}> failed because no controller found at subpath
helloperson
<ActionController::Routing::Route ":controller/:action/:id" ||
{:id=>nil, :action=>"index"}> failed because no controller found at
subpath helloperson

Any ideas what else I need to do?

thanks,

-ben
Ron DiFrango (Guest)
on 2006-01-31 21:15
(Received via mailing list)
I think you Controller needs to look like the following:

class HelloPerson < ApplicationController

   wsdl_service_name 'HelloPerson'

  def HelloName( name )
    return "Hello "+name;
  end
end


________________________________

From: removed_email_address@domain.invalid on behalf of Ben M.
Sent: Tue 1/31/2006 11:37 AM
To: removed_email_address@domain.invalid
Subject: [Rails] Creating a web service with AWS



So I've read the Action Web Service bit of the documentation for a
while, searched around and asked on the IRQ channel and I just can't
seem to get a simple Hello World type web service up and running with
AWS on Rails.

I have a file called hello_person_api.rb which looks like this:

class HelloPersonAPI < ActionWebService::API::Base
  api_method :HelloName, :expects =>[:string], :returns => [:string]
end

I have put that in the /app/apis/ directory. I also have a file named
hello_person.rb which contains this:

class HelloPerson < ApplicationController

  def HelloName( name )
    return "Hello "+name;
  end
end

I have put that in the /app/controllers/ directory.

As far as I can understand it, that ought to do something (although I
have no idea what path things are supposed to be on so they could be
in the wrong place) but when ask it to do anything I get this:

http://localhost:3000/HelloPerson

Routing Error

No route for path: "HelloPerson"

Failure reasons:
<ActionController::Routing::Route ":controller/service.wsdl" when
{:action=>"wsdl"}> failed because no controller found at subpath
helloperson
<ActionController::Routing::Route ":controller/:action/:id" ||
{:id=>nil, :action=>"index"}> failed because no controller found at
subpath helloperson

Any ideas what else I need to do?

thanks,

-ben
Ben M. (Guest)
on 2006-01-31 22:01
(Received via mailing list)
Thanks for this.

In the end, with a lot of help from folk on IRQ and random voodoo
experimentation  I got something up and running, which I should be
able to work with a bit. My main problem was that although I had
updated to the latest version of Rails my version of AWS was a bit old
and didn't work very well.

I've added a howto for a basic web service to the rails Wiki so anyone
else in my state of distress should hopefully be able to sort
themselves out...

-ben
This topic is locked and can not be replied to.