Hi, I have developed a web service using SOAP4R. in contoller I have def fetchfilename(comp) @files = Wsm.find_by_sql(["select filename from wsms where comp=?", comp]) end -------------------------------------------------------- Now in API I have defined:(note the return type here) api_method :fetchfilename, :expects => [:string], :returns => [Wsm] -------------------------------------------------------- My problem is I''m not able to get this to work. In SOAP Client when I do something like this: results = ws.fetchfilename("SYSCFG") results.each do |rec| puts rec.filename end It gives me "Don''t know how to cast Array to Wsmapping (RuntimeError)" Any input on what I''m missing? Thanks a bunch! -- 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 -~----------~----~----~----~------~----~------~--~---
On 9/19/06, Ruby Rails <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hi, > I have developed a web service using SOAP4R. in contoller I have > > def fetchfilename(comp) > @files = Wsm.find_by_sql(["select filename from wsms where comp=?", > comp]) > end > -------------------------------------------------------- > Now in API I have defined:(note the return type here) > api_method :fetchfilename, :expects => [:string], :returns => [Wsm] > -------------------------------------------------------- > My problem is I''m not able to get this to work. In SOAP Client when I do > something like this: > > results = ws.fetchfilename("SYSCFG") > results.each do |rec| > puts rec.filename > end > > It gives me "Don''t know how to cast Array to Wsmapping (RuntimeError)" > > Any input on what I''m missing? > >Try something like that api_method :fetchfilename, :expects => [:string], :returns => [[Wsm]] -- Kent --- http://www.datanoise.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 -~----------~----~----~----~------~----~------~--~---
Thanks! That worked! -- 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 -~----------~----~----~----~------~----~------~--~---