I am attempting to use ruby to connect to a webservice. I am able to
create a driver which contains all of the correct methods but when I
attempt to call a method I get the following error:
NoMethodError: undefined method `headerparts' for nil:NilClass
from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:355:in
`header_from_obj'
from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:272:in
`document_send'
from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:449:in
`helloWorld'
from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:448:in
`helloWorld'
from (irb):8
I'm using the document at
http://www.testing.com/writings/behind-the-screens.pdf as a guide for
using ruby to connect to a webservice.
The method is a simple helloWorld. I am inexperienced with both ruby
and webservices but it seems like I'm doing this correctly.
Any ideas? Is this user error or a bug in that library?
Thanks,
Matt
Hi,
I am attempting to use ruby to connect to a webservice. I am able to
create a driver which contains all of the correct methods but when I
attempt to call a method I get the following error:
NoMethodError: undefined method `headerparts' for nil:NilClass
from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:355:in
`header_from_obj'
from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:272:in
`document_send'
from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:449:in
`helloWorld'
from c:/ruby/lib/ruby/1.8/soap/wsdlDriver.rb:448:in
`helloWorld'
from (irb):8
I'm using the document at
http://www.testing.com/writings/behind-the-screens.pdf as a guide for
using ruby to connect to a webservice.
Would you please try to call WSDLDriverFactory#create_rpc_driver instead
of WSDLDriverFactory#createDriver to create a driver? createDriver was
deprecated. Sorry for the inconvenience.
If the problem still occurs, please tell me the WSDL you are using. It
may be a bug of soap4r.
Regards,
// NaHi
···
matt.hulse@gmail.com wrote:
Thank you for the response.
Using create_rpc_driver worked and I am able to call helloWorld now but
what I've noticed with the rpc_driver is that the expected argument is
always one even though the functions I'm calling either have no
parameters or 8 parameters. How do you pass arguments to the methods
while using an rpc driver since it will only accept one? Is there a
good tutorial somewhere on how to use soap/WSDLDriver?
I appreciate your help.
Matt
Hi,
Thank you for the response.
Using create_rpc_driver worked and I am able to call helloWorld now but
what I've noticed with the rpc_driver is that the expected argument is
always one even though the functions I'm calling either have no
parameters or 8 parameters. How do you pass arguments to the methods
while using an rpc driver since it will only accept one? Is there a
good tutorial somewhere on how to use soap/WSDLDriver?
I think you are accessing to document/literal service. You shoul pass a
Hash to a method of document/literal service.
driver.hello_world(:name => "NaHi", :age => 99)
And with a command line program wsdl2ruby.rb, you can generate stub
files for accessing to the service. A sample client generated will help
to understand how to create parameters. If you're using bundled library
in ruby (without installing an independent package at
http://dev.ctor.org/download/\), get wsdl2ruby.rb from
http://dev.ctor.org/soap4r/browser/trunk/bin/wsdl2ruby.rb
Regards,
// NaHi
···
matt.hulse@gmail.com wrote: