Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > SOAP wsdlDriver doesn't work without soap4r?

Reply
Thread Tools

SOAP wsdlDriver doesn't work without soap4r?

 
 
Henry Jen
Guest
Posts: n/a
 
      01-17-2009
Hi,

I am trying to access a SOAP web service implemented in Java(I
believe), but there is a problem for xsd:string type argument, the
result request message always be empty string if I don't have 'soap4r'
(Inspired by this thread[1]).

Also, code generated with wsdl2ruby works well.

Would you please help to me understand why? I consider this is a bug
unless there is an explanation.

Here is the request envelop without soap4r,

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlnssd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:login xmlns:n1="urn:com.example.cwp.cwpidws/wsdl/cwpidws"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<String_1 xsi:nil="true"></String_1>
<String_2 xsi:nil="true"></String_2>
<arrayOfString_3 n2:arrayType="xsd:string[3]"
xmlns:n2="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="n2:Array">
<item>EMAIL</item>
<item>LASTNAME</item>
<item>FIRSTNAME</item>
</arrayOfString_3>
</n1:login>
</env:Body>
</env:Envelope>

and here is the one with soap4r and works as expected,

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlnssd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:login xmlns:n1="urn:com.example.cwp.cwpidws/wsdl/cwpidws"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<String_1 xsi:type="xsd:string">username</String_1>
<String_2 xsi:type="xsd:string">password</String_2>
<arrayOfString_3 n2:arrayType="xsd:string[3]"
xmlns:n2="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="n2:Array">
<item>EMAIL</item>
<item>LASTNAME</item>
<item>FIRSTNAME</item>
</arrayOfString_3>
</n1:login>
</env:Body>
</env:Envelope>

The code is like following, only the wsdl URL and username/password
are masked from original code.

#require 'rubygems'
#gem 'soap4r'

require 'soap/wsdlDriver'
require 'pp'
wsdl = 'https://example.com/cwpidws/cwpidws?WSDL'
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_drive r

# Log SOAP request and response
driver.wiredump_file_base = "cwp-log.txt"

XSD::Charset.encoding = 'UTF8'
uid = 'username'
pwd = 'password'
response = driver.login(uid, pwd, [ "EMAIL", "LASTNAME", "FIRSTNAME" ])
pp(response)

The environments are

$ ruby -v
ruby 1.8.6 (2008-03-03 patchlevel 114) [universal-darwin9.0]
$ gem list soap4r
<snip>
soap4r (1.5.

Cheers,
Henry

[1] http://www.ruby-forum.com/topic/155169

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rubygems soap/wsdlDriver issue Alin Alin Ruby 2 01-16-2007 08:02 PM
Help needed with soap/wsdlDriver Tadeusz Bochan Ruby 0 08-25-2006 01:42 PM
Help Needed with soap/wsdlDriver tad.bochan@bnpparibas.com Ruby 0 08-25-2006 01:17 PM
Proxy question when using soap/wsdlDriver Jared Richardson Ruby 1 03-23-2006 03:57 PM
Error using soap/wsdlDriver matt.hulse@gmail.com Ruby 3 09-16-2005 09:35 PM



Advertisments