SOAP (NDFD weather web service) question

Hi,

Did by any chance anybody get the NDFD weather web service
(National Digital Forecast Database XML/SOAP Service - NOAA's National Weather Service) 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/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

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

-----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) 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/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

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