search for: api_method

Displaying 20 results from an estimated 68 matches for "api_method".

2006 Jun 13
0
CDATA as api_method expected parameter
I''d like to know if there is any way to accept a CDATA block as a parameter to an ActionWebService API method. I''d like to have something like this, class MyAPI < ActionWebService::API::Base api_method :test, :expects => [:cdata] end The client would pass "<![CDATA[ ...blah blah... ]]>" as the parameter to the method, test. Perhaps I need to specify :string as the expected type and somehow tell the parsing library to interpret the string as CDATA?
2006 Nov 04
1
layere dispatching - please help!
...r.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_car_by_id, :expects => [:int], :returns => [Car] api_method :find_car_by_name, :expects => [:string], :returns => [[Car]] end class CarService < ActionWebService::B...
2006 Jan 12
1
activewebservice::struct
So I''m playing with AWS. I''ve got a thing called a gallery. I''d like to return a list of them. I can do this fine if I want to return my ActiveRecord objects: class WxApiApi < ActionWebService::API::Base api_method :list_galleries, :expects=>[{:login=>:string}], :returns => [[Gallery]] end But the ActiveRecord object exposes a lot more than I really want to return via the web service. So I''m told I should dervice something from ActiveWebService::Struct, which I di...
2007 Jun 19
4
ActionWebService for many APIs in rails?
Hi, We''ve a pretty large rails application and we are currently deciding moving a part of the application front-end to a desktop GUI. For communication between application and GUI we decided to use an API. So basically what I need is a way to have our models functionality accessible by the GUI. The basic idea: Rails app provides API for models <-> HTTPS Connection <-> GUI
2006 May 24
2
array parameters in web services
...Base class CLL_Metadata < ActionWebService::Struct member :key, :string member :type, :string member :value, :string member :webapplication_id, :string member :user_tenfold_id, :string member :login_username, :string end api_method :GetMetadata, :expects => [{:metadata_type => :string}, {:metadata_key => :string}, {:metadata_value => :value}, {:webapplication_id => :string},...
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_me...
2007 Jun 06
0
ActionWebService API ignoring multiple return values?
I''m using ActionWebService and defining the following API method: api_method(:validate, :expects => [{:id => :int}, {:value => :string}], :returns => [{:valid => :boolean}, {:error_message => :string}]) if I implement this method as follows: def validate(id, value) return true, ''no error'' end I get the follo...
2006 May 02
3
web services on the client side
i am reading through chapter 20 of the agile web development book and trying to figure out how to use web services. i set up two different rails apps. one as the server and one as the client. setting up the server seems to work fine. but when i use the example at the end of the chapter to set up a client, i get the following error when i open the page: Missing API definition file in
2005 Dec 30
5
AWS api_method :returns not accepting ActiveRecord::Base
I''m trying to use the feature of AWS where it will take an object derived from ActiveRecord::Base instead of an AWS::Struct object. Whenever I try it, though, I get the craziest error: NoMethodError: You have a nil object when you didn''t expect it! The error occured while evaluating nil.new /usr/lib/.../actionwebservice/lib/action_web_service/casting.rb:105:in
2006 May 31
2
Rails Bug when loading required files for API?
...a remote system that expects a stucture: When defined like this (all definitions in one file) it all works fine: /app/apis/myws_api.rb ---------- class SoapResponse < ActionWebService::Struct member :id, :int member :title, :string end class MyApi < ActionWebService::API::Base api_method :find_products_by_category, :expects => [:string], :returns => [[SoapResponse]] end ---------- Now when I try to isolate my API code and my structures into a module (listing below) things go wrong, but in a weird way. When I restart my Webrick server the initial "/myws/invoke&quot...
2006 May 08
0
Including common code among multiple web services issue?
...#39;d like to do the same for the API''s, but can''t quite get there. If I try the same logic as above then when I go to /api/invoke all the methods show up as being of the "WebService" class. Right now I''ve got this and it works. I''d like to move that api_method line into a common file though. Since subclassing the Api''s another level didn''t work I''ve tried both require and load, but require doesn''t work at all, and load gives me an unknown method error for Object#api_method. -------------------------------------------...
2006 Mar 28
11
ActionWebService date casting error
I have defined a web service to return information from a database as follows. class BackendApi < ActionWebService::API::Base api_method :find_all_vobs, :returns => [[:int]] api_method :find_vob_by_id, :expects => [:int], :returns => [Vob] class BackendController < ApplicationController wsdl_service_name ''Backend'' web_service_scaffold :invoke def find_al...
2005 Jul 25
2
ActionWebService woes
I''m currently writing an app that provides a Web Service. I''ve got a model Header and an associated has_one HeaderImage and I''m trying to find a way to make this data available. Defining a normal API: api_method :header, :expects => [{''id'' => :int}], :returns => [Header] Only returns the header object without associations, has anyone got experience with using the Struct class? I''ve got the Rails book but the chapter on using th Struct class is less than comprehensive...
2006 Jan 06
6
AWS and array of Model
Hi! I try to use a layered webservice and I want to get back an array of users; In the API I use: api_method :listUsers,:returns=>[[User]] in the service: def listUsers User.find(:all) end Result in soap mode: Don''t know how to cast TrueClass to Object Result in XML-RPC mode: You have a nil object when you didn''t expect it! You might have expected an instance of...
2006 Jan 31
2
Creating a web service with AWS
...mentation for a while, searched around and asked on the IRQ channel and I just can''t seem to get a simple Hello World type web service up and running with AWS on Rails. I have a file called hello_person_api.rb which looks like this: class HelloPersonAPI < ActionWebService::API::Base api_method :HelloName, :expects =>[:string], :returns => [:string] end I have put that in the /app/apis/ directory. I also have a file named hello_person.rb which contains this: class HelloPerson < ApplicationController def HelloName( name ) return "Hello "+name; end end I have...
2006 Jul 31
5
ActionWebService API
Hi *, I need to pass a hash to a webservice, so I defined my API with: api_method :search, :expects => [{ :tags => :string, :assignment => :string, :resource => :string, :lesson_plan => :string, :subject => :string, :all_types => :string }], :returns => [[Resource]] when I try to test the webservice wit...
2006 Jul 13
8
can''t convert true into integer
I have a method: ? def reduceProuctInventoryBy(product_id, reduction) ? ? t=Product.find(:first, :conditions =>["id = ?", product_id]) ? ? t.qty=(t.qty-reduction) ? ? t.save ? end and the model: class Product < ActiveRecord::Base ? validates_presence_of :qty, :specialDescription ? validates_numericality_of :qty end but when i run my method, I get this: "can''t
2006 Aug 14
1
various returns parameters in action web service
I''m working with ActionWebService, building a SOAP Service. I realize that I can returns various values, in example: api_method :foo, :expects [ { :value1 => :int }, { :value2 => :int } ], :returns [ { :return_value_1 => :int}, { :return_value_2 => :string}, { :return_value_3 => :string} ] the question is as follows, then...
2006 Jul 13
1
Issue with Web Service
I have the following: File: subscription_api.rb class SubscriptionApi < ActionWebService::API::Base api_method :newTest, :returns => [ [[:string]] ] end File: subscription_controller.rb class SubscriptionController < ApplicationController wsdl_service_name ''Subscription'' web_service_scaffold :invoke def newTest() return [ [''a'',''a''],[...
2006 Jul 22
0
multiple return values in action web service
Hi all, Does anyone have any advice about returning multiple values from an ActionWebService? That is, I''d like to implement something like the following. api_method :do_something, :expects => [{:id => :string}], :returns => [{:return_code => :int}, {:return_text => :string}] The easy way to do it would be to wrap everything in a struct: class ReturnStatus < ActionWebService::Struct...