# Web serveces problem

**URL:** <https://www.ruby-forum.com/t/web-serveces-problem/75654>\
**Category:** Rails\
**Created:** [March 2, 2006, 11:12am UTC](https://www.ruby-forum.com/t/web-serveces-problem/75654 "2006-03-02T11:12:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shiko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@shiko](https://www.ruby-forum.com/u/shiko)\
**Post date:** [March 2, 2006, 11:12am UTC](https://www.ruby-forum.com/t/web-serveces-problem/75654/1 "2006-03-02T11:12:42Z")

</div>

Hi,  
I’m trying to added layered web services to my application and from some  
reason it’s not working for me. i’m working with ruby 1.84, rails 1.0.

here are my files:

1. app/apis/kate\_api.rb:

class KateAPI \< ActionWebService::API::Base  
inflect\_names false  
api\_method :check\_version, :expects =\> [:string], :returns =\> [:string]  
end

1. app/models/kate\_api\_service.rb : (tried to put it also in apis  
directory - where should it be??)

class KateAPIService \< ActionWebService::Base  
web\_service\_api KateAPI

```
def check_version (version)
	if version != '0.25'
		'you are trying to talk with Tyra version 0.25 with a different 

```

version !’  
else  
‘server and client versions match - 0.25’  
end  
end  
end

1. app/controller/kate\_controller.rb:

class KateController \< ApplicationController  
web\_service\_scaffold :invoke  
web\_service\_dispatching\_mode :layered  
web\_service :kate, KateAPIService.check\_version  
end

when I go to the browser to /myapp/kate/api i get:  
NoMethodError in #  
undefined method `check\_version’ for KateAPIService:Class

and in the log:  
oMethodError (undefined method `check_version' for KateAPIService:Class): .//app/controllers/kate_controller.rb:6 /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:207:in`load’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/dependencies.rb:39:in  
`require_or_load' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:22:in`depend\_on’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/dependencies.rb:178:in  
`require_dependency' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:134:in`load\_file!’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/dependencies.rb:97:in  
`const_load!' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:80:in`const\_load!’  
/usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/dependencies.rb:72:in  
`const_missing' routing.rb:234:in`traverse\_to\_controller’  
generated/routing/recognition.rb:7:in `eval' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:234:in`traverse\_to\_controller’  
generated/routing/recognition.rb:7:in `recognize_path' /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_controller/routing.rb:458:in`recognize!’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/dispatcher.rb:38:in  
`dispatch' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:117:in`handle\_dispatch’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick\_server.rb:83: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:173:in`start\_thread’  
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in`start’  
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in`start’  
/usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start' /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/webrick_server.rb:69:in`dispatch’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/servers/webrick.rb:59  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in`require’  
/usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/server.rb:28  
/usr/local/lib/ruby/site\_ruby/1.8/rubygems/custom\_require.rb:21:in  
`require' /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in`require’  
./script/server:3

any help would be appriciated. I’ve wasted lots of time on this…  
Thanks,  
Amir.

---

<div class="post-metadata">

**Author:** ![shiko](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e47774/32.png) [@shiko](https://www.ruby-forum.com/u/shiko)\
**Post date:** [March 2, 2006, 3:29pm UTC](https://www.ruby-forum.com/t/web-serveces-problem/75654/2 "2006-03-02T15:29:39Z")

</div>

Your controller should look like:

class KateController \< ApplicationController  
web\_service\_scaffold :invoke  
web\_service\_dispatching\_mode :layered  
web\_service :kate, KateAPIService.new  
end

On 3/2/06, amir lidor [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> end  
> version !’  
> web\_service\_dispatching\_mode :layered  
> .//app/controllers/kate\_controller.rb:6  
> /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active\_support/dependencies.rb:97:in  
> /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action\_controller/routing.rb:458:in  
> /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' `require’  
> Amir.
> 
> –  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

## – Kent

> **[DATANOISE.COM](https://www.datanoise.com/)**
>
> DATANOISE.COM - Contact us for any business inquiries
