My bad... I was calling the service on the wrong port.
As always, all work and no sleep make Rey9999 go blind.
On 22 Mag, 15:58, Rey9999
<reyfourn...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hello everyone,
>
> I am experiencing some difficulties with a web service I''m
creating.
>
> This webservice has a login method which checks some credentials
> against an user database. Everything works beautifully so far.
> Now I''m trying to add a method which creates an instance of an
object
> (which, incidentally, belongs_to an user).
> So i added the following to my api and service definition:
>
> class MywsApi < ActionWebService::API::Base
>
> inflect_names false
> api_method :login, :expects => [[:string]], :returns => [[:int] ]
> api_method :newThing, :expects => [[:string]], :returns => [:int]
#<-
> added this line
>
> end
>
> class MywsService < ActionWebService::Base
> web_service_api MywsApi
>
> def login(name, password)
>
> #does stuff to authenticate
> end
>
> def newThing(session_id, param1, param2) #<-Added this method
>
> @user = User.find(session_id)
> @thing= @user.things.build({:user => @user, :field1 =>
> param1, :field2=> param2})
> if @thing.save
> return 0
> else
> return 1
> end
> end
>
> end
>
> The login method works perfectly, but when I fire the newThing event I
> receive a most saddening:
> "http 405: method not allowed".
>
> Am I missing something? do I need to add anything elsewhere to get
> another method working?
> Any help would be immensely appreciated.
>
> Thanks in advance.
>
> Regards,
> Rey9999
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---