Forum: Ruby different results between wsdl2ruby and wsdlDriver

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Matt R. (Guest)
on 2006-01-30 20:50
(Received via mailing list)
Sorry for barging in like this, but I've spent a few days looking for
this
info somewhere online, and I've just gone through the mailing list
archive, and I can't find anything anywhere.  I'm trying to talk to an
apache AXIS server, and I managed to send and receive responses to and
from this server using the stub files generated by wsdl2ruby.  I'm
pretty
much at the beginner level on every programming language except for bash
programming.  I really like ruby, and I'm confused why this isn't
working.

I think the problem comes down to a SOAP method that can have two
different types of calls.

there's one call: server_List, that can take two different types of
arguments.

1. credentials, customerID (which is numeric)
2. credentials, searchCriteria (which is a string)

When I use the stub files generated by wsdl2ruby, it somehow chooses the
2nd method for this server_List, and I get the result I want.

when I use the wsdlDriver code, it somehow uses the first method, and
when
I try and give it a search string, it craps out on me, with an error
that
the datatype is wrong.

This is a wiredump of the server_List call that uses the wsdl2ruby
driver
stubs.  this call doesn't error out.

"<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<env:Envelope
xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n
xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\"\n
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n  <env:Body>\n
<n1:server_List xmlns:n1=\"urn:ActivationServer\"\n
env:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n
<credentials xmlns:n2=\"http://types.api.nable.com\"\n
xsi:type=\"n2:T_Credentials\">\n        <password
xsi:type=\"xsd:string\">******</password>\n      <userName
xsi:type=\"xsd:string\">******</userName>\n      </credentials>\n
<searchCriteria xsi:type=\"xsd:int\">defiant</searchCriteria>\n
</n1:server_List>\n  </env:Body>\n</env:Envelope>"

This is the error I get when I make the same call using the wsdlDriver.

Exception `ArgumentError' at
/usr/local/lib/ruby/1.8/xsd/datatypes.rb:1014
- invalid value for Integer: "defiant"
Exception `XSD::ValueSpaceError' at
/usr/local/lib/ruby/1.8/xsd/datatypes.rb:1016 -
{http://www.w3.org/2001/XMLSchema}int: cannot accept 'defiant'.
/usr/local/lib/ruby/1.8/xsd/datatypes.rb:1016:in `screen_data_str':
{http://www.w3.org/2001/XMLSchema}int: cannot accept 'defiant'.
(XSD::ValueSpaceError)




This is the segment of driver code that is generated by wsdl2ruby

     [ XSD::QName.new("urn:ActivationServer", "server_List"),
       "",
       "server_List",
       [ ["in", "credentials", ["T_Credentials",
"http://types.api.nable.com", "T_Credentials"]],
         ["in", "customerID", ["::SOAP::SOAPInt"]],
         ["retval", "Server_ListReturn", ["T_Server[]",
"http://types.api.nable.com", "T_Server"]] ],
       { :request_style =>  :rpc, :request_use =>  :encoded,
         :response_style => :rpc, :response_use => :encoded }
     ],
     [ XSD::QName.new("urn:ActivationServer", "server_List"),
       "",
       "server_List",
       [ ["in", "credentials", ["T_Credentials",
"http://types.api.nable.com", "T_Credentials"]],
         ["in", "searchCriteria", ["::SOAP::SOAPString"]],
         ["retval", "Server_ListReturn", ["T_Server[]",
"http://types.api.nable.com", "T_Server"]] ],
       { :request_style =>  :rpc, :request_use =>  :encoded,
         :response_style => :rpc, :response_use => :encoded }
     ],


Thanks for any help any of you can give me.  If you need more info, I'm
still subscribed to the list.
NAKAMURA, Hiroshi (Guest)
on 2006-03-05 15:30
(Received via mailing list)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Sorry for late reply.

Matt R. wrote:
> 2nd method for this server_List, and I get the result I want.
Unfortunately soap4r cannot handle method overload.  Latter method
definition overwrites the former definition.

Stub files generated by wsdl2ruby and wsdlDriver should work as same I
think.  I must be slipping over something.  Can you show me the WSDL?

Regards,
// NaHi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iD8DBQFECueaf6b33ts2dPkRAvUWAKCvya1oGuietr1khfdreFQYN5FrFgCfRiBz
xU905442hNd27atBuUJ4lic=
=T00+
-----END PGP SIGNATURE-----
This topic is locked and can not be replied to.