Forum: Ruby on Rails Expect an array in webservice gives "Not supported" message

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Jazzy B. (Guest)
on 2007-06-11 11:06
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 =>
              :returns  =>  [:string]

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

THNX in advance.....
Steve R. (Guest)
on 2007-06-11 19:34
      :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 R. (Guest)
on 2007-06-11 19:37
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).

This topic is locked and can not be replied to.