Jazzy Buddy
2007-Jun-11 07:06 UTC
Expect an array in webservice gives "Not supported" message
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..... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Steve Rawlinson
2007-Jun-11 15:34 UTC
Re: Expect an array in webservice gives "Not supported" mess
: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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Steve Rawlinson
2007-Jun-11 15:37 UTC
Re: Expect an array in webservice gives "Not supported" mess
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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---