Forum: Ruby on Rails ActionWebService API ignoring multiple return values?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
255991ba3dd5d02c306024e85a204500?d=identicon&s=25 Colleen (Guest)
on 2007-06-06 23:05
(Received via mailing list)
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 when I try to invoke it:

undefined method `remote_addr' for
#<ActionWebService::Protocol::SimpleActionPackRequest:0x34bdd60>

It seems to be expecting only one return value, with type boolean.

When I look at the AWS code, it seems to be written this way (this is
lines 36-39 in casting.rb for AWS 1.2.3):

def cast_returns(api_method, return_value) # :nodoc:
  return nil if api_method.returns.nil?
  cast(return_value, api_method.returns[0])
end

Am I doing something wrong? Can't AWS have more than one return value?
What should that look like in the implementation?

Thanks in advance.

Colleen
This topic is locked and can not be replied to.