# Expect an array in webservice gives "Not supported" message

**URL:** <https://www.ruby-forum.com/t/expect-an-array-in-webservice-gives-not-supported-message/106490>\
**Category:** Rails\
**Created:** [June 11, 2007, 9:06am UTC](https://www.ruby-forum.com/t/expect-an-array-in-webservice-gives-not-supported-message/106490 "2007-06-11T09:06:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jazzybuddy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@jazzybuddy](https://www.ruby-forum.com/u/jazzybuddy)\
**Post date:** [June 11, 2007, 9:06am UTC](https://www.ruby-forum.com/t/expect-an-array-in-webservice-gives-not-supported-message/106490/1 "2007-06-11T09:06:47Z")

</div>

I am trying to expect an array of strings in the webservice api. It says  
“Typed array input fields not supported yet”.  
Can anybody suggest me how I can expect an array in action\_webservices.

The code is as given below.

class SendInvitesApi \< ActionWebService::API::Base  
api\_method :send\_mails,  
:expects =\> [:invitation\_details =\>  
InvitationDetailsVO],  
:returns =\> [:string]  
end

class InvitationDetailsVO \< ActionWebService::Struct  
member :names, [:string] ##This is an array of strings.  
end

THNX in advance…

---

<div class="post-metadata">

**Author:** ![jazzybuddy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@jazzybuddy](https://www.ruby-forum.com/u/jazzybuddy)\
**Post date:** [June 11, 2007, 5:34pm UTC](https://www.ruby-forum.com/t/expect-an-array-in-webservice-gives-not-supported-message/106490/2 "2007-06-11T17:34:57Z")

</div>

```
  :expects => [:invitation_details => InvitationDetailsVO],

```

I’m not sure that you’re allowed to tell the api to expect an object  
defined elswhere, I think it has to be one of the allowed xml types.  
Plus, what you’ve defined here is not an array because :expects needs an  
array anyway if you see what I mean. Try:

:expects =\> [[:invitation\_details =\> :string]]

Which will get your api to accept an array of strings. Your :returns  
method there returns a single string as it stands. If you want to return  
an array of strings use [[:string]].

steve

---

<div class="post-metadata">

**Author:** ![jazzybuddy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/f4b2a3/32.png) [@jazzybuddy](https://www.ruby-forum.com/u/jazzybuddy)\
**Post date:** [June 11, 2007, 5:37pm UTC](https://www.ruby-forum.com/t/expect-an-array-in-webservice-gives-not-supported-message/106490/3 "2007-06-11T17:37:35Z")

</div>

PS. the AWS::Struct stuff is to allow to _return_ structures not defined  
as models. Not to accept them. Plus, in the case you have quoted about  
you don’t need to use a struct because you only have one member which is  
a normal type (array of string).

steve
