Define a class like this in your models folder

class MyUserWS < ActiveResource::Base
    self.site = "http://localhost/";    # point this to the location of
your web service
    self.format = :json                  # default format is xml.
include this line if you want json
    self.element_name = "users"    # if your class name (MyUserWS in
this case) is different from the name of the webservice you are
calling, Mention the real name here
    self.user = "[email protected]"  # if your webserive need user
authentication mention user name and password
    self.password = "mypassword"
end

Once you have this... you can instanciate MyUserWS as if it is a model
on local database table. You can do all activerecord operations on it
as you do on your models

Regards
Shireesh

On Feb 28, 9:03 pm, gs84 <[email protected]> wrote:
> Hi every body,
>
> I use rest web service in my rails application for user's
> authentication (user creation, login, ...)
> Can someone explain me, how can i call a REST Web service  (not
> developped in Rails, and deployed by Tomcat) in my rails application
> via POST method.
>
> Thanks in advance for your help

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to