Displaying 16 results from an estimated 16 matches for "web_service".
2006 Apr 21
8
web services and dealing with before_filter
...er to the login screen if they haven''t already
logged in. Pretty standard stuff.
But, if I want to setup a web service, how do I set session data from the
client side through, say, an xmlrpc call using layered dispatching? I''ve tried
messing around with the block form of the web_service, and even tried setting
up a LoginApi and LoginService, but no luck.
I''d like to be able to do this:
require ''xmlprc/client''
rpc = XMLRPC::Client.new(''localhost'', ''http://localhost/webservice/api'', 3000)
rpc.call(''login.log...
2007 Jul 26
2
rspec_resource error
...ator?.
When I run script/generate I get the following:
Installed Generators
Plugins: authenticated, rspec, rspec_controller, rspec_model,
rspec_scaffold
Builtin: controller, integration_test, mailer, migration, model, observer,
plugin, resource, scaffold, scaffold_resource, session_migration,
web_service
Could anyone spread any light as to why rspec_resource isn''t being
installed? Sorry for the simple question but I can''t seem to find any help
on the rspec rubyforge page or through google.
Any help would be much appreciated.
Thanks,
P
[1] http://rspec.rubyforge.org/document...
2006 Nov 04
1
layere dispatching - please help!
Hi Folks,
I''m having trouble with setting up web services with layered
dispatching.
I''ve defined my controller (backend_controller.rb) as:
class BackendController < ApplicationController
web_service_dispatching_mode :layered
web_service_scaffold :invoke
web_service (:car) {CarService.new}
end
and my service (node_service.rb) as:
class CarApi < ActionWebService::API::Base
api_method :find_all_cars,
:returns => [[:int]]
api_method :find_ca...
2006 Mar 02
1
web serveces problem
...s KateAPI < ActionWebService::API::Base
inflect_names false
api_method :check_version, :expects => [:string], :returns => [:string]
end
2. 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
3. app/controller/kate_controller...
2006 Dec 01
3
Sessions in Layered Dispatching
Can you use sessions in layered dispatching? I used them in direct
dispatching without any problems, but switching to layered throws an
error (saying session doesn''t exist).
Sorry if this is a double post, Google Groups isn''t posting my message
for some reason.
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this
2006 Jan 04
5
Webservice External XMLRPC
...e some trouble getting my webservice to run .
I have the following webservice :
class DirectSpoolAPI < ActionWebService::API::Base
api_method :add, :expects => [{:html=>:string},{:from=>:string}],
:returns => [Customer]
end
class DirectSpoolService < ActionWebService::Base
web_service_api DirectSpoolAPI
def add(html,from)
Customer.find(:first)
end
def remove
end
end
class ApiController < ApplicationController
skip_before_filter :login_required
web_service_dispatching_mode :delegated
web_service_scaffold :invoke
web_service(:directspool) {Direc...
2006 Jan 06
6
AWS and array of Model
...nother ampty project with Only this model, and only
one controller.
In controller used this code (the model is the default generated):
class UserAdminAPI < ActionWebService::API::Base
api_method :listUsers,:returns=>[[User]]
end
class UserAdminService < ActionWebService::Base
web_service_api UserAdminAPI
def listUsers
User.find(:all)
end
end
class AdminController < ApplicationController
wsdl_service_name ''Admin''
web_service_dispatching_mode :delegated
web_service_scaffold :invoke
web_service(:user) { UserAdminService.new }
end
W...
2007 Dec 13
3
Realise a web service with ruby on rails.
Hi ,
I want realize a web service with rails, but it''s the response it''s
very slow. I want only saw all element present in my base.
I did a base Customers (with element like id, name, phone,...). I
added two elements.
I did a model customer, a web_service customer.
In the file /app/apis/customer_api.rb
class CustomerApi < ActionWebService::API::Base
api_method :listid, :expects => [:int], :returns => [Customer]
api_method :listall, :returns => [[:int]]
In the file /app/controller/customer_controller.rb
class CustomerController &l...
2006 Jun 07
0
Logger in ActionWebService::Base?
...at logger is
not a class_variable of AWS::Base. This kind of scares me away from
using the layered dispatch mode, as I''d like to have logging in the
method implementations. Is there a clean way of accessing the
Rails::Configuration logger from ActionWebService::Base, or should I
stick with web_service_dispatch_mode :direct for now?
class FooController < ApplicationController
web_service_dispatching_mode :layered
web_service(:bar) { BarService.new }
end
class BarApi < ActionWebService::API::Base
api_method :qux
end
class BarService < ActionWebService::Base
def qux
p logge...
2006 May 22
0
General path question
...s that will deal with all the
wweb service call in the model diectory. I called it
postcode_anywhere_service.rb. My first question is: should it be a
singleton (will that be scalable do you beleive?) I know this is
somewhat a general question and would be happy to hear some advices.
So I have this web_Service class defined in my model directory. In my
controller (postcode_controller), I want to initialize
postcode_anywhere_service.rb only once (per user? I am not sure which
is best - should I initialize it once for all users or once per usere.
Each user will have a couple of request...). I put it in th...
2006 May 24
0
rails not liking api folder
Has anyone had trouble with their controller for an AWS webservice not being
able to see the api class when it is in the api folder? I used the
''script/generate web_service'' to make a webservice and api and the only way
it works is to move my api file into the controller folder and not have it
in the api folder. Is this normal?
Ben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/at...
2010 Nov 02
0
webservice - get client ip address
Hi
I have the following problem in my application I have
in the controller:
class XmlrpcController < ApplicationController
web_service_dispatching_mode :layered
wsdl_service_name ''weblogUpdates.ping''
web_service_scaffold :invoke
web_service :weblogUpdates, WeblogUpdates.new
end
in the api definition file:
-------
class WeblogUpdatesApi < ActionWebService::API::Base
inflect_names false
api...
2006 Feb 28
2
Authentication on delegated web service methods -or- How the heck do I protect these things?
I need to restrict access to only certain parts of a web service I''m building.
Instead of requiring a client to submit their user/pass with each interaction I''d like to login them in once (currently using acts_as_authenticated in the rest of the site) and not have to fuss with it again during that session. Only problem is I can''t use AAA on an ActionWebService
2006 Jun 05
3
Best practices with Web Services
Hello--
I''m investigating the API facet of my site and wanted to ask a couple
questions:
1. The Agile book describes adding an API using the web_services
generator which adds stuff to app/api. In Rails 1.1, Jamis added some
wants.xml stuff to the controller code which also allows API generation.
Which is better to use now? Do they mutually exclude one another?
2. In some cases, I will want to remove or rename certain attributes
from the API...
2006 May 17
3
WebServices: execution expired
1 hour spent and I can''t got explanation why I have "execution expired"
when I trying to test this web service:
Pointed to: http://localhost:3000/news/list
class NewsService < ActionWebService::Base
web_service_api NewsApi
def list
[NewsTopic.new, NewsTopic.new]
end
end
class NewsController < ApplicationController
wsdl_service_name ''news''
web_service_dispatching_mode :delegated
web_service :news, NewsService.new
def list
news = ActionWebService::Client::Soap.ne...
2006 Apr 14
8
Error with Web Service tests after upgrading to Rails 1.1.2
...ails --include-dependencies
then I upgraded my application (as myself) with:
? rake rails:update
% rake rails:update:configs
After these steps, working before Web Services functional tests broke.
To try to isolate the problem, I scaffolded a simple Web Services
Controller:
% ./script/generate web_service Problem my_method
Running the test on this Controller, I get:
% ruby test/functional/problem_api_test.rb
Loaded suite test/functional/problem_api_test
Started
E
Finished in 0.047129 seconds.
1) Error:
test_my_method(ProblemControllerApiTest):
NoMethodError: You have a nil object when you didn&...