search for: web_service_api

Displaying 20 results from an estimated 28 matches for "web_service_api".

2009 Aug 25
5
uninitialized constant
API-> hello_message_api.rb. class HelloMessageApi < ActionWebService::API::Base api_method :hello_message, :expects => [{:firstname=>:string}, {:lastname=>:string}], :returns => [:string] end controller -> class HelloMessageController < ApplicationController web_service_api HelloMessageApi web_service_dispatching_mode :direct wsdl_service_name ''hello_message'' web_service_scaffold :invoke def hello_message(firstname, lastname) return "Hello "+ firstname +" "+lastname end end but it givesthe following error " uni...
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 Apr 17
7
Should Perl talk to Rails via LWP
Hi folks, I need your opinions on a basic design issue. I''ve seen the light of RoR and have replaced my Perl (DBI/CGI) based web server <-> RDBMS communication with RoR, but I still have a whole host of users (other servers/OS''s etc) out there wanting to talk to my RDBMS and they only talk Perl. Also they don''t want to talk Perl/DBI directly (they are not allowed
2008 May 07
1
uninitialized constant HelloadminController::HelloApi
...HelloadminController::HelloApi service api class HelloApi < ActionWebService::API::Base api_method :getMsg, :expects => [:name=>:string], :returns => [:string] end service controller class HelloController < ApplicationController wsdl_service_name ''Hello'' web_service_api HelloApi web_service_scaffold :invoke def getMsg(name) "Hello " + name end end client controller class HelloadminController < ApplicationController def getMsg hello_client = ActionWebService::Client::Soap.new(HelloApi, "http://localhost:3001/hello/api") @serv...
2006 Nov 04
1
layere dispatching - please help!
...cars, :returns => [[:int]] api_method :find_car_by_id, :expects => [:int], :returns => [Car] api_method :find_car_by_name, :expects => [:string], :returns => [[Car]] end class CarService < ActionWebService::Base web_service_api CarApi def find_all_cars Car.find(:all).map{ |car| car.id } end def find_car_by_id(id) Car.find(id) end def find_car_by_name(name) Car.find(:all, :conditions => ["name = ?", name]) end...
2006 Jan 12
2
Web services and login?
...as anyone managed to do this? I thought about using sessions but they dont want to work for me... Here''s what I''m doing as a little test: class NotLoggedIn < Exception end class ProjectsController < ApplicationController wsdl_service_name ''Projects'' web_service_api ProjectsApi def Login @session[:loggedIn] = true end def GetProjects if @session[:loggedIn] return Project.find(:all) else raise NotLoggedIn, "You are not logged in!" end end def CreateProject(name) Project.create(:name => name) return name << &qu...
2006 Sep 11
5
WebServices & controllers
Hi, I am having problems with REST web-service support. I have a simple controller: class DocumentsController < ApplicationController wsdl_service_name ''Documents'' web_service_api DocumentsApi web_service_scaffold :invoke def list @docs = Document.find(:all) respond_to do |wants| wants.html wants.xml { return @docs .to_xml } end end end Then, my api is defined as follow: class DocumentsApi < ActionWebService::API::Base api_method :list, :...
2006 Apr 10
3
Regarding using Web service to handle file uploads
I am trying to code a Web Service in rails that can handle file uploads. Now as i read, SOAP 1.1 doesn''t support this yet..so i will have to use SOAP4R, right? This is fine from server side...but will this API will be compatible to .NET clients, which will be using standard SOAP API perhaps. Any idea, whats the way to go here?
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) {DirectSpo...
2007 Jan 18
2
How to use API from AWS -- help!
...controllers/user_controller.rb 3) apis/user_api.rb 1) Model: User.rb - This file just holds some business logic for maintaining the users. 2) Controller: class UserController < ApplicationController and below this line at the top of the file, I have: wsdl_service_name ''User'' web_service_api UserApi then my method implementations. 3) ApiDefinition: UserApi.rb - this file has all of my "api_method" calls and details what methods expect and return. Now, that''s how I''m setup, and I''ve tested all of this and followed the AWDWRv2 book. My problem is...
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 What&...
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.rb:...
2006 May 08
0
Including common code among multiple web services issue?
...mplementing some web services and every one has at the very least a "find_newer_than" method. In my models, I''ve split things up like this and it works great. ---------------------------------------------------------------------------------- class XyzService < WebService web_service_api XyzApi .... service specific methods go here... end class WebService < ActionWebService::Base def find_newer_than(created_at) real_class.find(:all, :conditions => [''created_at >= ?'', TimeZone[''London''].unadjust(created_at)])...
2006 May 22
0
logger and ActionWebService - how can I get them to work together?
...e tried and true methodology of using print statements. However, I can''t seem to get Logger to output anything to my ~/log/test.log file. Here''s an example: class LibraryServiceController < ApplicationController wsdl_service_name ''LibraryService'' web_service_api LibraryServiceApi # format is <controller_name>Api web_service_scaffold :invoke def new_item(username, type, title, length, size, state, unique_key) @user = User.find_by_login(username) logger.fatal(@user) puts @user true end end In #new_item I can''t ge...
2006 Jan 26
1
Webservices and submitting object with associations
Hi - is there an easy way to submit an object with its associations as an :expects parameter to a AWS webservice? I know I could first create a webservice method for the object, and then call - in a loop - another webservice for each of my association objects. Is there an easier more elegant way, so that I don''t have to make so many expensive webservice calls? I was thinking
2006 Nov 21
2
before_filter in actionwebservice controller using direct dispatching
...authorize method in application.rb? undefined method `authorize'' for #<CustomerController:0x8ee54e0> class CustomerController < ActionController::Base after_filter :end_session before_filter :authorize web_service_dispatching_mode :direct web_service_scaffold :invoke web_service_api CustomerApi end Chris --~--~---------~--~----~------------~-------~--~----~ 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 unsubscrib...
2010 Nov 02
0
webservice - get client ip address
...e api definition file: ------- class WeblogUpdatesApi < ActionWebService::API::Base inflect_names false api_method :ping, :expects => [{:sitename=>:string}, {:url=>:string}], :returns => [XmlrpcStructs::PingInfo] end ------- class WeblogUpdates < ActionWebService::Base web_service_api WeblogUpdatesApi def ping(sitename, url) # a logic here .... return XmlrpcStructs::PingInfo.new(:flerror => flerror, :message => message) end end ------ Everything works here Now in my ping method I would like to use a request object How can I pass a request from the contro...
2006 Jan 31
0
webservice problem (cant make client)
...PI::Base api_method :authenticate, :expects => [{:twa =>:string},{:login =>:string},{:pass =>:string}], :returns => [{:responsecode =>:string}] end backend_controller.rb class BackendController < ApplicationController wsdl_service_name ''Backend'' web_service_api BackendApi web_service_scaffold :invoke # Constants TWA_INVALID = "TWA_INVALID" USER_NOT_FOUND = "USER_NOT_FOUND" USER_FOUND = "USER_FOUND" def authenticate(twa, login, pass) user = User.authenticate(login, pass) if user == nil then return US...
2007 Mar 19
0
action_web_services error with rspec_on_rails
...line): euclid% spec spec/controllers/crud_resource_controller_spec.rb spec/ controllers/crud_resource_controller_with_join_models_spec.rb /Users/smtlaissezfaire/Sites/rails/dictionary/vendor/rails/ actionwebservice/lib/action_web_service/container/ action_controller_container.rb:74:in `require_web_service_api'': neither _api or _api found (NameError) from /Users/smtlaissezfaire/Sites/rails/dictionary/vendor/ rails/actionwebservice/lib/action_web_service/container/ action_controller_container.rb:48:in `web_service_api'' from /Users/smtlaissezfaire/Sites/rails/diction...
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.new(...