# Still having problems with soap4R

**URL:** <https://rubytalk.org/t/still-having-problems-with-soap4r/12586>\
**Category:** ruby-talk\
**Created:** [14 July 2004 20:52 UTC](https://rubytalk.org/t/still-having-problems-with-soap4r/12586 "2004-07-14T20:52:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ernest\_Ellingson1](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@Ernest\_Ellingson1](https://rubytalk.org/u/Ernest_Ellingson1)\
**Post date:** [14 July 2004 20:52 UTC](https://rubytalk.org/t/still-having-problems-with-soap4r/12586/1 "2004-07-14T20:52:19Z")

</div>

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](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)

---

<div class="post-metadata">

**Author:** ![Ernest\_Ellingson1](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@Ernest\_Ellingson1](https://rubytalk.org/u/Ernest_Ellingson1)\
**Post date:** [15 July 2004 01:22 UTC](https://rubytalk.org/t/still-having-problems-with-soap4r/12586/2 "2004-07-15T01:22:19Z")

</div>

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](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](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

---

<div class="post-metadata">

**Author:** ![NAKAMURA\_Hiroshi1](https://avatars.discourse-cdn.com/v4/letter/n/fbc32d/32.png) [@NAKAMURA\_Hiroshi1](https://rubytalk.org/u/NAKAMURA_Hiroshi1)\
**Post date:** [15 July 2004 01:36 UTC](https://rubytalk.org/t/still-having-problems-with-soap4r/12586/3 "2004-07-15T01:36:19Z")

</div>

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](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](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](http://rubyinstaller.rubyforge.org/wiki/wiki.pl)

Regards,  
// NaHi

---

<div class="post-metadata">

**Author:** ![Ernest\_Ellingson1](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@Ernest\_Ellingson1](https://rubytalk.org/u/Ernest_Ellingson1)\
**Post date:** [15 July 2004 17:02 UTC](https://rubytalk.org/t/still-having-problems-with-soap4r/12586/4 "2004-07-15T17:02:18Z")

</div>

"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](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](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](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](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

---

<div class="post-metadata">

**Author:** ![NAKAMURA\_Hiroshi1](https://avatars.discourse-cdn.com/v4/letter/n/fbc32d/32.png) [@NAKAMURA\_Hiroshi1](https://rubytalk.org/u/NAKAMURA_Hiroshi1)\
**Post date:** [16 July 2004 00:50 UTC](https://rubytalk.org/t/still-having-problems-with-soap4r/12586/5 "2004-07-16T00:50:40Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![Ernest\_Ellingson1](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@Ernest\_Ellingson1](https://rubytalk.org/u/Ernest_Ellingson1)\
**Post date:** [16 July 2004 11:07 UTC](https://rubytalk.org/t/still-having-problems-with-soap4r/12586/6 "2004-07-16T11:07:16Z")

</div>

"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](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](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](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)

---

<div class="post-metadata">

**Author:** ![Ernest\_Ellingson1](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@Ernest\_Ellingson1](https://rubytalk.org/u/Ernest_Ellingson1)\
**Post date:** [16 July 2004 11:12 UTC](https://rubytalk.org/t/still-having-problems-with-soap4r/12586/7 "2004-07-16T11:12:17Z")

</div>

"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](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](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)

---

<div class="post-metadata">

**Author:** ![NAKAMURA\_Hiroshi1](https://avatars.discourse-cdn.com/v4/letter/n/fbc32d/32.png) [@NAKAMURA\_Hiroshi1](https://rubytalk.org/u/NAKAMURA_Hiroshi1)\
**Post date:** [16 July 2004 11:50 UTC](https://rubytalk.org/t/still-having-problems-with-soap4r/12586/8 "2004-07-16T11:50:03Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ernest\_Ellingson1](https://avatars.discourse-cdn.com/v4/letter/e/90db22/32.png) [@Ernest\_Ellingson1](https://rubytalk.org/u/Ernest_Ellingson1)\
**Post date:** [19 July 2004 20:52 UTC](https://rubytalk.org/t/still-having-problems-with-soap4r/12586/9 "2004-07-19T20:52:07Z")

</div>

"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](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](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

---

<div class="post-metadata">

**Author:** ![NAKAMURA\_Hiroshi1](https://avatars.discourse-cdn.com/v4/letter/n/fbc32d/32.png) [@NAKAMURA\_Hiroshi1](https://rubytalk.org/u/NAKAMURA_Hiroshi1)\
**Post date:** [20 July 2004 08:16 UTC](https://rubytalk.org/t/still-having-problems-with-soap4r/12586/10 "2004-07-20T08:16:03Z")

</div>

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](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](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
