# Problem in webservice

**URL:** <https://www.ruby-forum.com/t/problem-in-webservice/107169>\
**Category:** Rails\
**Created:** [June 18, 2007, 7:44pm UTC](https://www.ruby-forum.com/t/problem-in-webservice/107169 "2007-06-18T19:44:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 18, 2007, 7:44pm UTC](https://www.ruby-forum.com/t/problem-in-webservice/107169/1 "2007-06-18T19:44:48Z")

</div>

I have created a webservice named annonce (there is its code )  
class AnnonceApi \< ActionWebService::API::Base  
api\_method :find\_all\_annonces,  
:returns =\> [[:int]]

and its controller has been declared in this way:

class BackendController \< ApplicationController  
require ‘annonce\_api’

wsdl\_service\_name ‘Backend’  
web\_service\_api AnnonceApi  
web\_service\_scaffold :invoke

def find\_all\_annonces  
Annonce.find(:all).map{ |annonce| annonce.id }  
end  
end

when I try to test the invoke It work  
[http://localhost:3009/backend/invoke](http://localhost:3009/backend/invoke)  
but when a client try to access to this webservice , he receives 2  
kinds of errors

the first  
---- uninitialized constant ClientController::AnnonceApi  
when I use such method

opts = {}  
client = ActionWebService::Client::Soap.new(AnnonceApi, ‘http://  
localhost:3009/backend/api’,:namespace=\> “AnnonceApi”, :driver\_options  
=\> opts)

def list  
@annonces = client.find\_all\_annonces  
end  
the second error  
----- Missing API definition file in apis/annonce\_api.rb

when using the other method  
web\_client\_api :annonce,:soap,“[http://localhost:3009/backend/api](http://localhost:3009/backend/api)”

def list  
@annonces = client.find\_all\_annonces  
end

I need your help as soon as possible , because I am preparing a  
project of my end studies , and I still have just a week to end its  
so please if someone can answer me in this few days

thanks
