Forum: Ruby on Rails web service parameters

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.
B192011964906cffb106241f99cb4c3f?d=identicon&s=25 Rodrigo Dominguez (rdominguez)
on 2006-05-31 23:11
(Received via mailing list)
Can I return an structure array from a web service in rails?



I have this:



class CLL_Metadata < ActionWebService::Struct

  member :key,               :string

  member :type,              :string

end



and I want to do this:



class UnifiedLoginApi < ActionWebService::API::Base



  api_method :GetMetadata,

             :returns => [ [CLL_ Metadata] ]



but when I do:



class UnifiedLoginController < ApplicationController

  wsdl_service_name 'UnifiedLogin'

  web_service_scaffold :invoke



  def GetMetadata(metadata)

    metadata1 = CLL_Metadata.new

    metadata1.key = 'fdsafda'

    metadata1.type = '1'

    metadata1.value = '232'

    collection = [ metadata 1]

    collection

  end

end



it throws me an error: Don't know how to cast CLL_Metadatata into Array





Rodrigo Dominguez



Iplan Networks                Datos Personales

rdominguez@iplan.com.ar       rorra@rorra.com.ar

www.iplan.com.ar <http://www.iplan.com.ar/>
www.rorra.com.ar <http://www.rorra.com.ar/>

5031-6303                     15-5695-6027
This topic is locked and can not be replied to.