# Creating a web service with AWS

**URL:** <https://www.ruby-forum.com/t/creating-a-web-service-with-aws/99456>\
**Category:** Rails\
**Created:** [January 31, 2006, 5:39pm UTC](https://www.ruby-forum.com/t/creating-a-web-service-with-aws/99456 "2006-01-31T17:39:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [January 31, 2006, 5:39pm UTC](https://www.ruby-forum.com/t/creating-a-web-service-with-aws/99456/1 "2006-01-31T17:39:42Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [January 31, 2006, 8:15pm UTC](https://www.ruby-forum.com/t/creating-a-web-service-with-aws/99456/2 "2006-01-31T20:15:42Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![glenatron](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@glenatron](https://www.ruby-forum.com/u/glenatron)\
**Post date:** [January 31, 2006, 9:01pm UTC](https://www.ruby-forum.com/t/creating-a-web-service-with-aws/99456/3 "2006-01-31T21:01:29Z")

</div>

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
