Error using soap/wsdlDriver

M

matt.hulse

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
 
N

NAKAMURA, Hiroshi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)

iD8DBQFDKoY8f6b33ts2dPkRAjz0AJ9vjlIRJ01LHuKZbx/2lmduYtLkMgCfb0m7
1vZ4qa3PkI9k75QVUOZacFg=
=UQEO
-----END PGP SIGNATURE-----
 
M

matt.hulse

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
 
N

NAKAMURA, Hiroshi

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)

iD8DBQFDKzppf6b33ts2dPkRAh2XAJ43wAT4/7v8CkJ6MiHEofRMdmDySQCgsnpG
zRRoSW68VcC4AzLYL6dbXJw=
=w8t5
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top