Hi, I am new to Rails and just play around with the Action Web Service. when I run "script/generator web_service test method1", I got a test_controller and test_api, in which there is a empty method1 definition and I can get wsdl through http://localhost:3000/test/service.wsdl But after I add another method call "test2" as below in test_api.rb I added api_method(:test2, :returns => [[:int]]) in test_controller.rb I added def test2 [1, 2, 3, 4, 5] end I can no longer get wsdl generated, instead I got Template is missing Missing template ./script/../config/../app/views/test/wsdl.rhtml Does anyone know what was wrong? Thanks, -- 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 -~----------~----~----~----~------~----~------~--~---
This confused me at first because you are using a test_controller.rb, but this is not actually a unit or functional test. But, setting that aside. You created a new controller method named test2. If you don''t specify a specific view for this controller method, Rails will assume that the view is located in test2.rhtml. Do you have a test2.rhtml file under your views --> test folder? If not then this is why you are getting the "no template" error. On another note. Think about whether your really must use SOAP web services. If you are building this service for your own use then you may be much happier using a REST web service instead. I have pretty extensive experience with both, and I now choose REST over SOAP unless the project specs mandate a SOAP web service. And that only when I''m providing the service to a client requiring SOAP. On Apr 16, 2:11 am, anakintang <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > I am new to Rails and just play around with the Action Web Service. > > when I run "script/generator web_service test method1", I got a > test_controller and test_api, in which there is a empty method1 > definition and I can get wsdl throughhttp://localhost:3000/test/service.wsdl > > But after I add another method call "test2" as below > > in test_api.rb I added > > api_method(:test2, :returns => [[:int]]) > > in test_controller.rb I added > > def test2 > [1, 2, 3, 4, 5] > end > > I can no longer get wsdl generated, instead I got > > Template is missing > > Missing template ./script/../config/../app/views/test/wsdl.rhtml > > Does anyone know what was wrong? > > Thanks, > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
Robert Walker wrote:> This confused me at first because you are using a test_controller.rb, > but this is not actually a unit or functional test. But, setting that > aside. > > You created a new controller method named test2. If you don''t specify > a specific view for this controller method, Rails will assume that the > view is located in test2.rhtml. > > Do you have a test2.rhtml file under your views --> test folder? If > not then this is why you are getting the "no template" error. > > On another note. Think about whether your really must use SOAP web > services. If you are building this service for your own use then you > may be much happier using a REST web service instead. I have pretty > extensive experience with both, and I now choose REST over SOAP unless > the project specs mandate a SOAP web service. And that only when I''m > providing the service to a client requiring SOAP. > > On Apr 16, 2:11 am, anakintang <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>But look at the error message which says "Missing template ./script/../config/../app/views/test/wsdl.rhtml" it''s not looking for test2.rhtml. And also it''s just unreasonable to need extra template to make rails generate wsdl. Right? -- 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 -~----------~----~----~----~------~----~------~--~---
I just started with ruby on rails because ActionWebService had been recommended to publish SOAP Services that can be connected by third party products like .NET. I got almost the exact same problem.In my case I implemented a very simple controller: class LittlemathController < ApplicationController wsdl_service_name ''Littlemath'' web_service_scaffold :invoke def useful_sum(parameter1, parameter2) return parameter1 + parameter2 end end and a simple api: class LittlemathApi < ActionWebService::API::Base api_method :useful_sum, :expects => [:int, :int], :returns => [:int] end The service is working as expected on http://localhost:3000/littlemath/invoke but http://localhost:3000/littlemath/service.wsdl returns: Template is missing Missing template script/../config/../app/views/littlemath/wsdl.rhtml Did you find out the reason for that? Thank you for any help or advice. Greetings Peter anakintang wrote:> Robert Walker wrote: >> This confused me at first because you are using a test_controller.rb, >> but this is not actually a unit or functional test. But, setting that >> aside. >> >> You created a new controller method named test2. If you don''t specify >> a specific view for this controller method, Rails will assume that the >> view is located in test2.rhtml. >> >> Do you have a test2.rhtml file under your views --> test folder? If >> not then this is why you are getting the "no template" error. >> >> On another note. Think about whether your really must use SOAP web >> services. If you are building this service for your own use then you >> may be much happier using a REST web service instead. I have pretty >> extensive experience with both, and I now choose REST over SOAP unless >> the project specs mandate a SOAP web service. And that only when I''m >> providing the service to a client requiring SOAP. >> >> On Apr 16, 2:11 am, anakintang <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > > But look at the error message which says "Missing template > ./script/../config/../app/views/test/wsdl.rhtml" it''s not looking for > test2.rhtml. And also it''s just unreasonable to need extra template to > make rails generate wsdl. > > Right?-- 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 -~----------~----~----~----~------~----~------~--~---
I reply this myself. In my case it was a bad RoR installation. I uninstalled rails and ruby entirely and reinstalled it and then it worked fine. Just in case you encounter the same problem any time. Peter Peter Betzler wrote:> I just started with ruby on rails because ActionWebService had been > recommended to publish SOAP Services that can be connected by third > party products like .NET. > > I got almost the exact same problem.In my case I implemented a very > simple > controller: > > class LittlemathController < ApplicationController > wsdl_service_name ''Littlemath'' > web_service_scaffold :invoke > > def useful_sum(parameter1, parameter2) > return parameter1 + parameter2 > end > end > > and a simple api: > > class LittlemathApi < ActionWebService::API::Base > api_method :useful_sum, :expects => [:int, :int], :returns => [:int] > end > > The service is working as expected on > http://localhost:3000/littlemath/invoke > > but http://localhost:3000/littlemath/service.wsdl returns: > > Template is missing > > Missing template script/../config/../app/views/littlemath/wsdl.rhtml > > Did you find out the reason for that? > > Thank you for any help or advice. > > Greetings > > Peter > >-- 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 -~----------~----~----~----~------~----~------~--~---
Peter Betzler wrote:> I reply this myself. In my case it was a bad RoR installation. > I uninstalled rails and ruby entirely and reinstalled it and > then it worked fine. > > Just in case you encounter the same problem any time. > > PeterI''ve got the same problem right now... This is quite worrying, I created lot of webservices for my app, and it always worked. But suddenly, after updating my gems... would not display wsdl file anymore.. *geez* -- 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 -~----------~----~----~----~------~----~------~--~---
Fred Penz wrote:> Peter Betzler wrote: >> I reply this myself. In my case it was a bad RoR installation. >> I uninstalled rails and ruby entirely and reinstalled it and >> then it worked fine. >> >> Just in case you encounter the same problem any time. >> >> Peter > > I''ve got the same problem right now... > > This is quite worrying, I created lot of webservices for my app, and it > always worked. > But suddenly, after updating my gems... would not display wsdl file > anymore.. > > *geez*Hmmm this is actually disturbing. To be honest I did the same thing in the first place. I installed gems after I installed Ruby and Rails. Later I noticed, that gems are included in the distribution of ruby and rails. I use gentoo linux and because everything failed I reenstalled Ruby and Rails. Very simply emerge ruby; emerge rails and blub it worked. No gems nothing. Probably there is some kind of incompatibility to the gems availabe independent to the package. Might be a bad guess. Peter -- 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 -~----------~----~----~----~------~----~------~--~---
fred.penz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Oct-19 09:03 UTC
Re: Can not generate WSDL
I figured out this problem occures when loading soap4r after rubygems in boot.rb: require ''rubygems'' gem ''soap4r'' If you comment out the gem ''soap4r'', you''ll be able to get your wsdl file. I can''t remember why we need to load soap4r after actionwebservice exactly, but I know there are some compatibility problems between the two. I am not sure if that still occures in latest versions. That would need to be checked. Fred On 9 oct, 09:26, Peter Betzler <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Fred Penz wrote: > > Peter Betzler wrote: > >> I reply this myself. In my case it was a bad RoR installation. > >> I uninstalled rails and ruby entirely and reinstalled it and > >> then it worked fine. > > >> Just in case you encounter the same problem any time. > > >> Peter > > > I''ve got the same problem right now... > > > This is quite worrying, I created lot of webservices for my app, and it > > always worked. > > But suddenly, after updating my gems... would not display wsdl file > > anymore.. > > > *geez* > > Hmmm this is actually disturbing. To be honest I did the same thing in > the first place. I installed gems after I installed Ruby and Rails. > Later I noticed, that gems are included in the distribution of ruby and > rails. > I use gentoo linux and because everything failed I reenstalled Ruby and > Rails. Very simply emerge ruby; emerge rails and blub it worked. No gems > nothing. > Probably there is some kind of incompatibility to the gems availabe > independent to the package. Might be a bad guess. > > Peter > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
It also happens with rails-2.1.0 + soap4r-1.5.8 + datanoise-actionwebservice-2.1.0 Fred Penz wrote:> I figured out this problem occures when loading soap4r after rubygems > in boot.rb: > require ''rubygems'' > gem ''soap4r'' > > If you comment out the gem ''soap4r'', you''ll be able to get your wsdl > file. > I can''t remember why we need to load soap4r after actionwebservice > exactly, but I know there are some compatibility problems between the > two. > I am not sure if that still occures in latest versions. That would > need to be checked. > > Fred > > On 9 oct, 09:26, Peter Betzler <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>-- 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 -~----------~----~----~----~------~----~------~--~---
In case anyone else comes across this again, I had a similar problem when trying to create a wsdl and my browser telling me a template was missing. If you add the following to config/environments.rb module SOAP SOAPNamespaceTag = ''env'' XSDNamespaceTag = ''xsd'' XSINamespaceTag = ''xsi'' end Reboot server and see if it works. Did for me ;) I''m running on: Ruby version 1.8.6 (i386-mswin32) RubyGems version 1.3.5 Rack version 1.0 Rails version 2.3.2 Active Record version 2.3.2 Action Pack version 2.3.2 Active Resource version 2.3.2 Action Mailer version 2.3.2 Active Support version 2.3.2 datanoise-actionwebservice (2.3.2) -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.