I want to develop web services using ruby on rails , how can i , any
help ?
Hamid R. wrote:
I want to develop web services using ruby on rails , how can i , any
help ?
How is this urgent? Have you even searched the Internet for web
services on Rails?
Cheers,
Mohit.
6/17/2009 | 6:32 PM.
yup i searched and found this
http://www.ibm.com/developerworks/opensource/library/os-ws-rubyrails/index.html
but is there any other gem or plugin or way to make web services.
This link may be useful for you.
On Wed, Jun 17, 2009 at 3:50 PM, p_W [email protected] wrote:
Posted viahttp://www.ruby-forum.com/.
–
“Knowing others is intelligence;
knowing yourself is true wisdom.
Mastering others is strength;
mastering yourself is true power.â€
@ Robert W. :
Thanks,
let me tell you what is my problem , m using ActionWebService.
and have two applications on is server and other is client.
In server:
I defined an api in which i have a function which will return list of
articles, let me show u that decleration:
api_method :get_baby_growth_articles,
:expects => [{:userid=>:string}, {:lastUpdateDate=>:date}],
:returns => [Article]
this is the function this will return objects of Articles when called by
the cliet.
and the function’s definition defined in controller is :
def get_baby_growth_articles(login, lastUpdateDate)
unless is_registered(login)
return
end
return Article.find(:all,:conditions=>[“updated_at =>
?”,lastUpdateDate])
end
now if ill get its wsdl through url by giving
http://localhost:3000/baby_wise/wsdl
it simply returns wsdl
you can see its return type which is “typens:Article”
now the problem is
i m accessing this function in my other application just a dummy client
applcation
where i defined the same api(which is necessary) as defined in the api
of server and the function’s defination is same which is
api_method :get_baby_growth_articles,
:expects => [{:userid=>:string}, {:lastUpdateDate=>:date}],
:returns => [Article]
but here it doesnt recognize “Article”.
as i have to return list form the server , so i used Article in the
function’s decleration :returns => [Article]
notice: if i use :returns => [:string] it works , so the problem is
how can i return list.
hope u got it
thanx in advance.
Hamid R. wrote:
yup i searched and found this
but is there any other gem or plugin or way to make web services.
actionwebservice is pretty much still the way to do SOAP web services as
far as I know. However, you won’t find much support of doing web
services from the Rails core. Rails has a pretty clear opinion on how to
provide web services and that is though REST services not SOAP. This
opinion happens to coincide with my own. I’m ready for the rest of the
world to wake up to REST and let SOAP die a quiet death.
Even though the Rails core isn’t supporting actionwebservice anymore,
support is available in the latest Rails 2.3.2 in this project:
I’d only recommend this if you are stuck having to either implement an
existing SOAP service you have no control over. Or you must provide a
web service to clients that won’t accept REST.
There is a lot of information online regarding REST services in Rails.
All you have to do is look. You practically get REST services for free
just by building in Rails anyway (assuming you’re using the latest
techniques).