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

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.
553eecd4f9b81ada4b21a755efe025e6?d=identicon&s=25 Jazzy Buddy (jazzybuddy)
on 2007-06-11 09: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 =>
InvitationDetailsVO],
              :returns  =>  [:string]
end

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


THNX in advance.....
19990e3fa0fc68c874f42f13d1500011?d=identicon&s=25 Steve Rawlinson (trip)
on 2007-06-11 17: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
19990e3fa0fc68c874f42f13d1500011?d=identicon&s=25 Steve Rawlinson (trip)
on 2007-06-11 17: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).

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