Displaying 20 results from an estimated 1200 matches similar to: "ActionWebService for many APIs in rails?"
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
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''
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 with scaffold the
2009 Jun 17
2
validates_uniqueness_of fails on STI in Rails 2.3.2
I''ve got something like this:
class Position < ActiveRecord::Base
end
class CartItem < Position
validates_uniqueness_of :product_id
end
When I try to save CartItem I get this error:
ArgumentError: wrong number of arguments (1 for 2)
from
/home/joaz/.gem/ruby/1.8/gems/activerecord-2.3.2/lib/active_record/validations.rb:758:in
`exists?''
from
2005 Feb 24
8
web services with ActionWebService
<noobalert>
Uh, yeah. So my noob self is showing through again. I''m trying to
write a simple hello-world type web service with the ActionWebService
thingy. I didn''t get very far. I''ve only done web services stuff in
.NET, so I''m not exactly used to this sort of thing.
Anyhow, I have a file, person_api.rb in my app/apis folder. I want to
take a single
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 following error
2006 May 24
2
array parameters in web services
I''m working in a web service, actually, I have:
class UnifiedLoginApi < ActionWebService::API::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
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
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
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:
2006 May 31
2
Rails Bug when loading required files for API?
Hello,
I have seen some odd behaviour of my Web Services code plus some
''similar'' postings to this list, so I believe this may be a bug in
Rails. But I''m failry new to RoR, so maybe I''m doing something wrong.
I''ll explain:
I have a WS API defined, communicating with a remote system that
expects a stucture:
When defined like this (all
2006 Jun 07
0
Logger in ActionWebService::Base?
I''d like to split up my directly dispatched controller into a layered
dispatch setup with one controller and two services derived from
ActionWebService::Base. However, in doing this I found that 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
2007 Jan 27
0
Interchanging ActiveRecord and ActionWebService... Help with my problem and suggestions for Best Practices.
Okay, I''m try to support two situations "easily". I need to be able to
use either ActiveRecord or ActionWebService. So I''m trying to handle
this "switch" as transparently as possible.
I''m totally open to suggestions..
Thanks,
Jason
I''m getting the following error:
NoMethodError in Offer renewalController#payment_made
undefined method
2009 Feb 26
1
Problem w/ActionWebService and Inheritance in Service Params
I have a service method that takes a PaymentMethod which can either be a
CreditCard or a PayPal account. When I request the service and pass one
or the other it always comes over as a PaymentMethod; the service
doesn''t seem to know that the parameter is really a CreditCard or
PayPal. Here''s some sample code that illustrates what I''m talking about
more concretely:
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 Jul 25
2
web services client problem
hi all,
i have been trying to study web services using rails so far i succesful
with server implementations in REST,SOAP,XML-RPC but the client code is
troubling me.
i have done most of the coding as per the rails book agile web development
i.e implementations of the servers and when i invoke them they give result
but when i try to acces them through another controller it gives time out
error
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
2006 Feb 13
1
another simple question: per_page in pagination
Hi,
Why can''t I use a variable to specify the :per_page attribute when using
the most basic form of pagination? (if I use a hardcode number, it
runs) What did I do? Thx.
My code:
def list_orders
page_size = 20
...
order_pages, @orders = paginate(:orders, :per_page => page_size)
end
My Errors:
undefined method `>'' for false:FalseClass
RAILS_ROOT:
2006 Jan 20
2
AWS and passing in a Model
Hi,
I have a webservice. And I want to pass in, a model.
So, for example:
api_method :save_person, :expects => [Person]
When I do this I get an error saying that I cannot have ActiveRecord
objects as parameters. Fine. I can have AWS Structs as parameters. I
don''t want to start ''maintaining'' a struct everytime I change the table
structure od Persons.
So, is