Still having problems with soap4R

Installed Soap4r-1_5_2 no problem
Running Ruby 1.8.1 -`2 on Windows XP
Did this as instructed.
C:\RubyScripts\soapTest>wsdl2ruby.rb --wsdl ndfdXML.wsdl --classdef --force

This is what is returned. Same problem simpleType is an unknown element.

I, [2004-07-14T16:48:51. 40000 #1944] INFO -- app: Start of app.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
I, [2004-07-14T16:48:51.110000 #1944] INFO -- app: Creating class
definition.
I, [2004-07-14T16:48:51.110000 #1944] INFO -- app: Creates file
'default.rb'.
F, [2004-07-14T16:48:51.110000 #1944] FATAL -- app: Detected an exception.
Stopp
ing ... undefined method `each' for nil:NilClass (NoMethodError)
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:134:in
`collect_faul
t_messages'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:133:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/namedElements.rb:54:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/namedElements.rb:54:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:133:in
`collect_faul
t_messages'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:132:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/namedElements.rb:54:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/namedElements.rb:54:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:132:in
`collect_faul
t_messages'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:118:in
`collect_faul
ttype'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:25:in
`initialize'
C:/RubyScripts/soapTest/wsdl2ruby.rb:138:in `new'
C:/RubyScripts/soapTest/wsdl2ruby.rb:138:in `create_classdef'
C:/RubyScripts/soapTest/wsdl2ruby.rb:137:in `open'
C:/RubyScripts/soapTest/wsdl2ruby.rb:137:in `create_classdef'
C:/RubyScripts/soapTest/wsdl2ruby.rb:50:in `create_file'
C:/RubyScripts/soapTest/wsdl2ruby.rb:45:in `run'
c:/ruby/lib/ruby/1.8/logger.rb:522:in `start'
C:/RubyScripts/soapTest/wsdl2ruby.rb:236
I, [2004-07-14T16:48:51.120000 #1944] INFO -- app: End of app. (status: -1)

Well I've made some progress. At least I know where things are going wrong.
I'm not quite sure how to fix it though.

Apparently at obj2soap in wsdlRegistry.rb, the program attemps a mapping of
type_qname. It does this by refering to a hash TypeMap in typeMap.rb. That
hash only has keys of type XSD::XSD.....::TYPE. It fails to map
in obj2soap String
{http://www.nws.noaa.gov/forecasts/xml/DWMLgen/schema/ndfdXM
L.xsd}productType.

I never see it attempt to map
{http://www.nws.noaa.gov/forecasts/xml/DWMLgen/schema/ndfdXM
L.xsd}weatherParametersType because the whole program fails before that
attempt is made.

Is this a bug in soap4R or does Ruby 1.8.2 fix something that is causing
soap4r to fail?

Thanks again
Ernie

Hi,

It seems to be a versioning problem.

Ernie wrote:

Installed Soap4r-1_5_2 no problem
Running Ruby 1.8.1 -`2 on Windows XP
Did this as instructed.

I installed 1.8.1GA(2003-12-25) and soap4r/1.5.2. It seems to work for me.

% ruby1.8.1 wsdl2ruby.rb --wsdl "http://www.adessosystems.net/adessosql/adessosql.asmx?WSDL" --classdef --force
I, [2004-07-15T10:20:09.629793 #3860] INFO -- app: Creating class definition.
W, [2004-07-15T10:20:09.630793 #3860] WARN -- app: File 'default.rb' exists but overrides it.
I, [2004-07-15T10:20:09.631793 #3860] INFO -- app: End of app. (status: 0)

No "simpleType" should be dumped if you use plain soap4r/1.5.2. (IIRC this warning is added after ruby/1.8.1 and soap4r/1.5.2 and will be fixed in ruby/1.8.2-preview1 which might be released today).

Can you please try "Stable snapshot" at http://www.ruby-lang.org/en/20020102.html or wait new RubyInstaller[1] which includes ruby's stable-snapshot >20040703.

[1] http://rubyinstaller.rubyforge.org/wiki/wiki.pl

Regards,
// NaHi

"NAKAMURA, Hiroshi" <nahi@keynauts.com> wrote in message
news:40F5DF86.9090901@keynauts.com...

Hi,

It seems to be a versioning problem.

Ernie wrote:
> Installed Soap4r-1_5_2 no problem
> Running Ruby 1.8.1 -`2 on Windows XP
> Did this as instructed.

I installed 1.8.1GA(2003-12-25) and soap4r/1.5.2. It seems to work for

me.

% ruby1.8.1 wsdl2ruby.rb --wsdl
"http://www.adessosystems.net/adessosql/adessosql.asmx?WSDL&quot; --classdef
--force
I, [2004-07-15T10:20:09.629793 #3860] INFO -- app: Creating class
definition.
W, [2004-07-15T10:20:09.630793 #3860] WARN -- app: File 'default.rb'
exists but overrides it.
I, [2004-07-15T10:20:09.631793 #3860] INFO -- app: End of app. (status:

0)

No "simpleType" should be dumped if you use plain soap4r/1.5.2. (IIRC
this warning is added after ruby/1.8.1 and soap4r/1.5.2 and will be
fixed in ruby/1.8.2-preview1 which might be released today).

Can you please try "Stable snapshot" at
http://www.ruby-lang.org/en/20020102.html or wait new RubyInstaller[1]
which includes ruby's stable-snapshot >20040703.

[1] http://rubyinstaller.rubyforge.org/wiki/wiki.pl

Regards,
// NaHi

Thanks for the suggestion.
I downloaded and installed the Ruby 1.82 version on the rubyinstaller site
Just to check I did this
C:\RubyScripts\soapTest>ruby -v
ruby 1.8.2 (2004-06-29) [i386-mswin32]

Then I reinstalled soap4r-1_5_2

Then I did this and got the same error.

C:\RubyScripts\soapTest>wsdl2ruby.rb --wsdl ndfdXML.wsdl --classdef --force
I, [2004-07-15T12:48:36.410000 #2656] INFO -- app: Start of app.
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
I, [2004-07-15T12:48:36.500000 #2656] INFO -- app: Creating class
definition.
W, [2004-07-15T12:48:36.500000 #2656] WARN -- app: File 'default.rb' exists
but
overrides it.
F, [2004-07-15T12:48:36.500000 #2656] FATAL -- app: Detected an exception.
Stopp
ing ... undefined method `each' for nil:NilClass (NoMethodError)
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:134:in
`collect_faul
t_messages'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:133:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/namedElements.rb:54:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/namedElements.rb:54:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:133:in
`collect_faul
t_messages'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:132:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/namedElements.rb:54:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/namedElements.rb:54:in `each'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:132:in
`collect_faul
t_messages'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:118:in
`collect_faul
ttype'
c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:25:in
`initialize'
C:/RubyScripts/soapTest/wsdl2ruby.rb:138:in `new'
C:/RubyScripts/soapTest/wsdl2ruby.rb:138:in `create_classdef'
C:/RubyScripts/soapTest/wsdl2ruby.rb:137:in `open'
C:/RubyScripts/soapTest/wsdl2ruby.rb:137:in `create_classdef'
C:/RubyScripts/soapTest/wsdl2ruby.rb:50:in `create_file'
C:/RubyScripts/soapTest/wsdl2ruby.rb:45:in `run'
c:/ruby/lib/ruby/1.8/logger.rb:684:in `start'
C:/RubyScripts/soapTest/wsdl2ruby.rb:236
I, [2004-07-15T12:48:36.540000 #2656] INFO -- app: End of app. (status: -1)

Am I still doing something wrong?

Ernie

Hi,

Ernie wrote:

I downloaded and installed the Ruby 1.82 version on the rubyinstaller site
Just to check I did this
C:\RubyScripts\soapTest>ruby -v
ruby 1.8.2 (2004-06-29) [i386-mswin32]

Then I reinstalled soap4r-1_5_2

Then I did this and got the same error.

I think it is because the version of soap module in 1.8.2 (2004-06-29) is newer than soap4r/1.5.2. The installer of soap4r/1.5.2 must not overwrite some files.

Then I put soap4r/1.5.3-preview1 at
http://rrr.jin.gr.jp/download/soap4r-1_5_3-preview1.tar.gz

Would you please try it with ruby 1.8.2 (2004-06-29) ? Unpack soap4r/1.5.3-preview1 package and run installer with your ruby 1.8.2 (2004-06-29) [i386-mswin32].

Please feel free to ask me again if you'll still have the same error.

Regards,
// NaHi

"NAKAMURA, Hiroshi" <nahi@keynauts.com> wrote in message
news:40F72653.6080204@keynauts.com...

Hi,

Ernie wrote:
> I downloaded and installed the Ruby 1.82 version on the rubyinstaller

site

> Just to check I did this
> C:\RubyScripts\soapTest>ruby -v
> ruby 1.8.2 (2004-06-29) [i386-mswin32]
>
> Then I reinstalled soap4r-1_5_2
>
> Then I did this and got the same error.

I think it is because the version of soap module in 1.8.2 (2004-06-29)
is newer than soap4r/1.5.2. The installer of soap4r/1.5.2 must not
overwrite some files.

Then I put soap4r/1.5.3-preview1 at
http://rrr.jin.gr.jp/download/soap4r-1_5_3-preview1.tar.gz

Would you please try it with ruby 1.8.2 (2004-06-29) ? Unpack
soap4r/1.5.3-preview1 package and run installer with your ruby 1.8.2
(2004-06-29) [i386-mswin32].

Please feel free to ask me again if you'll still have the same error.

Regards,
// NaHi

"NAKAMURA, Hiroshi" <nahi@keynauts.com> wrote in message
news:40F72653.6080204@keynauts.com...

Hi,

Ernie wrote:
> I downloaded and installed the Ruby 1.82 version on the rubyinstaller

site

> Just to check I did this
> C:\RubyScripts\soapTest>ruby -v
> ruby 1.8.2 (2004-06-29) [i386-mswin32]
>
> Then I reinstalled soap4r-1_5_2
>
> Then I did this and got the same error.

I think it is because the version of soap module in 1.8.2 (2004-06-29)
is newer than soap4r/1.5.2. The installer of soap4r/1.5.2 must not
overwrite some files.

Then I put soap4r/1.5.3-preview1 at
http://rrr.jin.gr.jp/download/soap4r-1_5_3-preview1.tar.gz

Would you please try it with ruby 1.8.2 (2004-06-29) ? Unpack
soap4r/1.5.3-preview1 package and run installer with your ruby 1.8.2
(2004-06-29) [i386-mswin32].

Please feel free to ask me again if you'll still have the same error.

Regards,
// NaHi

Well NaHi we're still having a problem only this time its a new one. I
downloaded soap4r/1.5.3-preview1 and installed it. Tried running
wsdl2ruby.rb and ran into this. This is turning into a great test case. I
suspect once this problem is overcome, all the others will seem trivial by
comparison.
Thanks for taking all the time and effort to make this work.

Ernie

C:\RubyScripts\soapTest>wsdl2ruby.rb --wsdl ndfdxml.wsdl --classdef --force
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
I, [2004-07-15T23:27:26.095000 #2364] INFO -- app: Creating class
definition.
W, [2004-07-15T23:27:26.095000 #2364] WARN -- app: File 'default.rb' exists
but
overrides it.
F, [2004-07-15T23:27:26.105000 #2364] FATAL -- app: Detected an exception.
Stopp
ing ... undefined method `collect_simpletypes' for
#<WSDL::Definitions:0x2c85b58

(NoMethodError)

c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:22:in
`initialize'
C:/RubyScripts/soapTest/wsdl2ruby.rb:148:in `new'
C:/RubyScripts/soapTest/wsdl2ruby.rb:148:in `create_classdef'
C:/RubyScripts/soapTest/wsdl2ruby.rb:147:in `open'
C:/RubyScripts/soapTest/wsdl2ruby.rb:147:in `create_classdef'
C:/RubyScripts/soapTest/wsdl2ruby.rb:57:in `create_file'
C:/RubyScripts/soapTest/wsdl2ruby.rb:52:in `run'
c:/ruby/lib/ruby/1.8/logger.rb:684:in `start'
C:/RubyScripts/soapTest/wsdl2ruby.rb:246
I, [2004-07-15T23:27:26.105000 #2364] INFO -- app: End of app. (status: -1)

"NAKAMURA, Hiroshi" <nahi@keynauts.com> wrote in message
news:40F72653.6080204@keynauts.com...

Hi,

Ernie wrote:
> I downloaded and installed the Ruby 1.82 version on the rubyinstaller

site

> Just to check I did this
> C:\RubyScripts\soapTest>ruby -v
> ruby 1.8.2 (2004-06-29) [i386-mswin32]
>
> Then I reinstalled soap4r-1_5_2
>
> Then I did this and got the same error.

I think it is because the version of soap module in 1.8.2 (2004-06-29)
is newer than soap4r/1.5.2. The installer of soap4r/1.5.2 must not
overwrite some files.

Then I put soap4r/1.5.3-preview1 at
http://rrr.jin.gr.jp/download/soap4r-1_5_3-preview1.tar.gz

Would you please try it with ruby 1.8.2 (2004-06-29) ? Unpack
soap4r/1.5.3-preview1 package and run installer with your ruby 1.8.2
(2004-06-29) [i386-mswin32].

Please feel free to ask me again if you'll still have the same error.

Regards,
// NaHi

We're still having problems even with the 1.5.3 preview. Thanks for taking
all the time to work this through. At least now the error message is
shorter. ; )
Haven't had a chance to look deeper into this problem on this end.

Thanks again
Ernie

C:\RubyScripts\soapTest>wsdl2ruby.rb --wsdl ndfdxml.wsdl --classdef --force
Unknown element {http://www.w3.org/2001/XMLSchema}simpleType.
I, [2004-07-15T23:27:26.095000 #2364] INFO -- app: Creating class
definition.
W, [2004-07-15T23:27:26.095000 #2364] WARN -- app: File 'default.rb' exists
but
overrides it.
F, [2004-07-15T23:27:26.105000 #2364] FATAL -- app: Detected an exception.
Stopp
ing ... undefined method `collect_simpletypes' for
#<WSDL::Definitions:0x2c85b58

(NoMethodError)

c:/ruby/lib/ruby/site_ruby/1.8/wsdl/soap/classDefCreator.rb:22:in
`initialize'
C:/RubyScripts/soapTest/wsdl2ruby.rb:148:in `new'
C:/RubyScripts/soapTest/wsdl2ruby.rb:148:in `create_classdef'
C:/RubyScripts/soapTest/wsdl2ruby.rb:147:in `open'
C:/RubyScripts/soapTest/wsdl2ruby.rb:147:in `create_classdef'
C:/RubyScripts/soapTest/wsdl2ruby.rb:57:in `create_file'
C:/RubyScripts/soapTest/wsdl2ruby.rb:52:in `run'
c:/ruby/lib/ruby/1.8/logger.rb:684:in `start'
C:/RubyScripts/soapTest/wsdl2ruby.rb:246
I, [2004-07-15T23:27:26.105000 #2364] INFO -- app: End of app. (status: -1)

Hi,

Ernie wrote:

We're still having problems even with the 1.5.3 preview. Thanks for taking
all the time to work this through. At least now the error message is
shorter. ; )
Haven't had a chance to look deeper into this problem on this end.

Hmm. I'm sorry but I'm off this weekend. I'll back next Tuesday.

The last try of this week. rm -rf c:/ruby/lib/ruby/site_ruby/1.8/{soap,wsdl,xsd} and re-install soap4r/1.5.3.

See you next week.

Regards,
// NaHi

"NAKAMURA, Hiroshi" <nahi@keynauts.com> wrote in message
news:40F7C0BE.9070507@keynauts.com...

Hi,

Ernie wrote:
> We're still having problems even with the 1.5.3 preview. Thanks for

taking

> all the time to work this through. At least now the error message is
> shorter. ; )
> Haven't had a chance to look deeper into this problem on this end.

Hmm. I'm sorry but I'm off this weekend. I'll back next Tuesday.

The last try of this week. rm -rf
c:/ruby/lib/ruby/site_ruby/1.8/{soap,wsdl,xsd} and re-install

soap4r/1.5.3.

See you next week.

Regards,
// NaHi

Your last suggestion did the trick. wsdl2ruby worked fine and the code was
able to retrieve the weather forecast. Something must have been hanging
around with the install over the existing 1_5_3 installation. Thanks so
much for working through this with me. Here are the steps and th code to
retireve one latitude and longitude coordinates for the next 7 days.

First retrieve the wsdl from NOAA at
http://www.nws.noaa.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl
Save the wsdl as nfdXML.wsddl
then

C:\rubyscripts\sopaTest>> wsdl2ruby.rb --wsdl
ndfdXML.wsdl --classdef --force
This creates a default.rb file.

then run this code

require 'default.rb'
require 'soap/wsdlDriver'
t= Time.now
starter = Time.local(t.year,t.mon, t.day) + (24 *3600)
ender=starter + 7 * 24 *3600
lattitude=39.0
longitude=-77.0
params=WeatherParametersType.new(nil, nil, true, true,
nil,nil,nil,nil,nil,nil,nil,nil,nil)
drv =
SOAP::WSDLDriverFactory.new("http://www.nws.noaa.gov/forecasts/xml/DWMLgen/w
sdl/ndfdXML.wsdl").create_driver
ret=drv.NDFDgen(lattitude, longitude, ProductType::TimeSeries, starter,
ender, params)
File.open("forecast.xml","w"){|f| f.write(ret)}

This particular example retrieves temperature and dew point for the next 7
days.

Thanks again

Ernie

Hi,

Ernie wrote:

Your last suggestion did the trick. wsdl2ruby worked fine and the code was
able to retrieve the weather forecast.

Good.

This kind of installation problem can happen when ruby/1.8.2 (and WindowsInstaller of it) released. Check lib/ruby/site_ruby/1.8 dir synchronized with lib/ruby/1.8 dir. (For safe upgrade, remove site_ruby dir before installing new ruby).

Here are the steps and th code to
retireve one latitude and longitude coordinates for the next 7 days.

First retrieve the wsdl from NOAA at
http://www.nws.noaa.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl
Save the wsdl as nfdXML.wsddl
then

C:\rubyscripts\sopaTest>> wsdl2ruby.rb --wsdl
ndfdXML.wsdl --classdef --force
This creates a default.rb file.

You can create client driver files here as follows;

% wsdl2ruby.rb --wsdl http://www.nws.noaa.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl --type client --force
I, [2004-07-20T17:00:28.493174 #3356] INFO -- app: Creating class definition.
I, [2004-07-20T17:00:28.494174 #3356] INFO -- app: Creates file 'default.rb'.
I, [2004-07-20T17:00:28.506174 #3356] INFO -- app: Creating driver.
I, [2004-07-20T17:00:28.506174 #3356] INFO -- app: Creates file 'defaultDriver.rb'.
I, [2004-07-20T17:00:28.514174 #3356] INFO -- app: Creating client skelton.
I, [2004-07-20T17:00:28.514174 #3356] INFO -- app: Creates file 'ndfdXMLClient.rb'.
I, [2004-07-20T17:00:28.516174 #3356] INFO -- app: End of app. (status: 0)

See the file "ndfdXMLClient.rb" generated and just modify it as follows.

#!/usr/bin/env ruby
require 'defaultDriver.rb'
endpoint_url = ARGV.shift
obj = NdfdXMLPortType.new(endpoint_url)

t = Time.now
startTime = Time.local(t.year,t.mon, t.day) + (24 *3600)
endTime = startTime + 7 * 24 *3600
latitude = 39.0
longitude = -77.0
product = ProductType::TimeSeries
weatherParameters = WeatherParametersType.new(nil, nil, true, true, nil,nil,nil,nil,nil,nil,nil,nil,nil)

puts obj.nDFDgen(latitude, longitude, product, startTime, endTime, weatherParameters)

This must work as your sample. This sample does not retrieve and parse the WSDL file at runtime so it's faster than wsdlDriver.rb. But retrieving WSDL each time can easily follows server endpoint change. Just an option.

Regards,
// NaHi