# SOAP (NDFD weather web service) question

**URL:** <https://www.ruby-forum.com/t/soap-ndfd-weather-web-service-question/64479>\
**Category:** Ruby\
**Created:** [June 26, 2006, 9:21am UTC](https://www.ruby-forum.com/t/soap-ndfd-weather-web-service-question/64479 "2006-06-26T09:21:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [June 26, 2006, 9:21am UTC](https://www.ruby-forum.com/t/soap-ndfd-weather-web-service-question/64479/1 "2006-06-26T09:21:04Z")

</div>

Hi,

Did by any chance anybody get the NDFD weather web service  
([National Digital Forecast Database XML/SOAP Service - NOAA's National Weather Service](http://www.nws.noaa.gov/forecasts/xml/#use_it)) to work in Ruby? Being  
new to SOAP/Ruby, here is what I (unsuccessfully) tried:

require ‘soap/rpc/driver’  
ndfd =  
SOAP::RPC::Driver.new(‘[NuSOAP: ndfdXML](http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php)’,  
‘[http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl](http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl)’)  
ndfd.add\_method(‘NDFDgenByDay’)  
puts ndfd.NDFDgenByDay(38.99, -77.99, ‘24 hourly’, ‘2004-04-27’, 3)

When I run the script I get the following error:

/usr/local/lib/ruby/1.8/soap/rpc/driver.rb:230:in `NDFDgenByDay’: wrong  
number of arguments (5 for 0) (ArgumentError)  
from weather.rb:6

I also tried to call the method like this:

puts ndfd.NDFDgenByDay(‘Latitude’ =\> 38.99, ‘Longitude’ =\> -77.99,  
‘Format’ =\> ‘24 hourly’, ‘Start Date’ =\> ‘2004-04-27’, ‘Number of Days’  
=\> 3)

but got the same error

I just don’t get why the method seems to expect “O” arguments?

Ingo

---

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [June 26, 2006, 10:10pm UTC](https://www.ruby-forum.com/t/soap-ndfd-weather-web-service-question/64479/2 "2006-06-26T22:10:00Z")

</div>

Ingo W. wrote:

> Hi,
> 
> Did by any chance anybody get the NDFD weather web service  
> ([National Digital Forecast Database XML/SOAP Service - NOAA's National Weather Service](http://www.nws.noaa.gov/forecasts/xml/#use_it)) to work in Ruby? Being

…

> I just don’t get why the method seems to expect “O” arguments?
> 
> Ingo

I did not, but I think maybe you should call add\_method with 5  
arguments. I have seen something like that Googling ‘SOAP add\_method’.

Harmen

---

<div class="post-metadata">

**Author:** ![ingoweiss](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/77aa72/32.png) [@ingoweiss](https://www.ruby-forum.com/u/ingoweiss)\
**Post date:** [July 15, 2006, 4:38pm UTC](https://www.ruby-forum.com/t/soap-ndfd-weather-web-service-question/64479/3 "2006-07-15T16:38:45Z")

</div>

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

Hi,

Ingo W. wrote:

> Did by any chance anybody get the NDFD weather web service  
> ([http://www.nws.noaa.gov/forecasts/xml/#use\_it](http://www.nws.noaa.gov/forecasts/xml/#use_it)) to work in Ruby? Being  
> new to SOAP/Ruby, here is what I (unsuccessfully) tried:
> 
> require ‘soap/rpc/driver’  
> ndfd =  
> SOAP::RPC::Driver.new(‘[NuSOAP: ndfdXML](http://www.weather.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php)’,  
> ‘[http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl](http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl)’)  
> ndfd.add\_method(‘NDFDgenByDay’)  
> puts ndfd.NDFDgenByDay(38.99, -77.99, ‘24 hourly’, ‘2004-04-27’, 3)

Why don’t you try NDFD sample client in soap4r distribution? It seems  
to work for me.

[http://dev.ctor.org/soap4r/browser/trunk/sample/wsdl/noaa](http://dev.ctor.org/soap4r/browser/trunk/sample/wsdl/noaa)

Regards,  
// NaHi

-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRLj9EB9L2jg5EEGlAQJA1AgAvc5GsvWJYy+XX5ZQaUFBKI5Ly9wNMJG9  
yChk0b2vsxx2v7e5fFmU7k8EM0ByEfM2Fwl7AD4HVxXHKcUfnyHVOgPQLssCjkSq  
UL4SN/hBqzQmsAyPDNAOi6bjKTVRNxtzRXeikNe3jfQsZCgagFe6rNm/QsqGwBRP  
lnLt2rHiUHYGafUWGBmyLsonZEUT2xyTpst/cQ8Nc66tUnHoKYu2cO44pp6/y987  
fHE/xHZ3S1b+GVB7mrCtjrHMg0wL8cjaS86AvEMppHYdY6h2uCR0DrqRmi8729n7  
fQSa1X2GXUGU10NldGJeJgGNu3MPFTxdWUNlHxawksX1IpyBnUhgag==  
=ddUQ  
-----END PGP SIGNATURE-----
