# ActionWebService API ignoring multiple return values?

**URL:** <https://www.ruby-forum.com/t/actionwebservice-api-ignoring-multiple-return-values/106160>\
**Category:** Rails\
**Created:** [June 6, 2007, 11:05pm UTC](https://www.ruby-forum.com/t/actionwebservice-api-ignoring-multiple-return-values/106160 "2007-06-06T23:05:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colleen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/f19dbf/32.png) [@Colleen](https://www.ruby-forum.com/u/Colleen)\
**Post date:** [June 6, 2007, 11:05pm UTC](https://www.ruby-forum.com/t/actionwebservice-api-ignoring-multiple-return-values/106160/1 "2007-06-06T23:05:50Z")

</div>

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
