I am a beginner so please excuse me, if i am doing something totally wrong. I have created a class using "wsdl2ruby.rb" and here is what it looks like: class ServiceSoap < ::SOAP::RPC::Driver DefaultEndpointUrl = "http://balrog/services/SearchWorker/service.asmx" MappingRegistry = ::SOAP::Mapping::Registry.new Methods = [ ... -- Posted via http://www.ruby-forum.com/.
I am a beginner so please excuse me, if i am doing something totally wrong. I have created a class and here is what it looks like: class ServiceSoap < ::SOAP::RPC::Driver DefaultEndpointUrl = "http://balrog/services/SearchWorker/service.asmx" MappingRegistry = ::SOAP::Mapping::Registry.new ... ... def initialize(endpoint_url = nil) endpoint_url ||= DefaultEndpointUrl super(endpoint_url, nil) self.mapping_registry = MappingRegistry init_methods end ... ... end I put in in app/controllers folder as "defaultDriver.rb" in another controller, I am doing require ''defaultDriver.rb'' class RmssearchController < ApplicationController layout "standard-layout" def view obj = ServiceSoap.new(nil) # line 10 response = ServiceSoap.helloWorld(nil) render :text => response end end and I am getting "uninitialized constant ServiceSoap" error at line 10 Any help is appreciated. Thnaks in Advanve. Pradeep -- Posted via http://www.ruby-forum.com/.
You don''t need to pass "nil" to the ServiceSoap constructor, try just ServiceSoap.new On 5/1/06, Pradeep Sethi <psethi@gmail.com> wrote:> > I am a beginner so please excuse me, if i am doing something totally > wrong. > > I have created a class and here is what it looks like: > > class ServiceSoap < ::SOAP::RPC::Driver > DefaultEndpointUrl > "http://balrog/services/SearchWorker/service.asmx" > MappingRegistry = ::SOAP::Mapping::Registry.new > ... > ... > def initialize(endpoint_url = nil) > endpoint_url ||= DefaultEndpointUrl > super(endpoint_url, nil) > self.mapping_registry = MappingRegistry > init_methods > end > ... > ... > end > > I put in in app/controllers folder as "defaultDriver.rb" > > in another controller, I am doing > > require ''defaultDriver.rb'' > > class RmssearchController < ApplicationController > layout "standard-layout" > > def view > obj = ServiceSoap.new(nil) # line 10 > response = ServiceSoap.helloWorld(nil) > render :text => response > end > end > > and I am getting "uninitialized constant ServiceSoap" error at line 10 > > Any help is appreciated. Thnaks in Advanve. > > Pradeep > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060501/98d01f15/attachment.html
Btw, If I use irb in that directory, it works fine.>irbirb(main):001:0> require ''rmsdefaultDriver.rb'' => true irb(main):002:0> obj = ServiceSoap.new(nil) => #<ServiceSoap:#<SOAP::RPC::Proxy:http://balrog/services/SearchWorker/service. asmx>> irb(main):004:0> p obj.helloWorld(nil) #<HelloWorldResponse:0x2e40748 @helloWorldResult="Hello World"> => nil Pradeep Sethi wrote:> I am a beginner so please excuse me, if i am doing something totally > wrong. > > I have created a class and here is what it looks like: >-- Posted via http://www.ruby-forum.com/.