class Sampleclass attr_reader :temp_arr,:temp_hash,:temp_str def initialize(temp_arr,temp_hash,temp_str) @temp_arr=temp_arr @temp_hash=temp_hash @temp_str=temp_str end class TestApi < ActionWebService::API::Base api_method :get_me, :returns => [Sampleclass] end class TestController < ApplicationController wsdl_service_name ''Test'' web_service_api TestApi web_service_scaffold :invocation if Rails.env == ''development'' def get_me #[get_indices(),get_stocks(),get_summary(),DateTime.now.to_s] indices = get_indices() stocks = get_stocks() summary = get_summary() current_time = DateTime.now tempsnapshot = Snapshot.new(indices,stocks,summary,current_time) tempsnapshot [Sampleclass.new([''1'',''2'',3''], {''a'' => ''1'', ''b'' => ''2'' }, ''something'' ) ] end end i got this error Don''t know how to cast Sampleclass to Sampleclass how do i define custom classes as return paramters -- 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 -~----------~----~----~----~------~----~------~--~---
disregard this section #[get_indices(),get_stocks(),get_summary(),DateTime.now.to_s] indices = get_indices() stocks = get_stocks() summary = get_summary() current_time = DateTime.now tempsnapshot = Snapshot.new(indices,stocks,summary,current_time) tempsnapshot -- 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 -~----------~----~----~----~------~----~------~--~---
nevermind the above posts i wasnt paying attention i created a model Sample changed code to class TestApi < ActionWebService::API::Base api_method :get_me, :returns => [Sample] end class MarketdataController < ApplicationController ... def poll Sample.find(:all,:limit =>1) end here i get all sorts of mapping errors #1 returns => [Sample] #it should expect a Sample object i return a Sample.find(:all,:limit=>1)[0] and i get a "Cannot map Sample to SOAP/OM" i return a Sample.find(:all,:limit=>1) #which would return an array containing Sample objects , it errors out and says "Don''t know how to cast Array to Sample" thats expected then i tried this #2 returns => [[Sample]] #it should expect an array of sample objects ? i return a sample.find(:all,:limit=>1) and i get a "Cannot map Array to SOAP/OM" Any ideas on how to get it to cast properly ? -- 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 -~----------~----~----~----~------~----~------~--~---