From: "NAKAMURA, Hiroshi" Date: 2005-04-16T22:12:31+09:00 Subject: Re: soap4r and nws.noaa.gov (moving from ruby-core) --------------enig8F08C48CF177F2CE04F88706 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi again, NAKAMURA, Hiroshi wrote: >>>A somewhat useful description of the XML response can be found at >>>http://weather.gov/mdl/XML/Design/MDL_XML_Design.pdf . I had something >>>better, but I'm not sure where it is. A document containing the "NDFD >>>XML Schema" is >>>http://products.weather.gov/PDD/Extensible_Markup_Language.pdf (See >>>appendix B), but I didn't find that to be very useful. Basically, if >>>you understand the keys it's pretty easy to convert the XML response >>>into something usable. I had it almost working, but then my motherboard > > Thank you. I'll look into this. Seems to be a simple XML structure as you said. Here is an example. # To run the following code, you need to get the latest # soap4r module from SVN repository. Regards, // NaHi ## preparing 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 ## accessing through dynamically generated driver require 'soap/wsdlDriver' params = {:maxt => false, :mint => false, :temp => true, :dew => true, :pop12 => false, :qpf => false, :sky => false, :snow => false, :wspd => false, :wdir => false, :wx => false, :waveh => false, :icons => false} wsdl = "http://weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl" drv = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver drv.wiredump_dev = STDOUT if $DEBUG dwml = drv.NDFDgen(lattitude, longitude, 'time-series', starter, ender, params) puts dwml soap = SOAP::Processor.unmarshal(dwml) data = SOAP::Mapping.soap2obj(soap["data"]) data.parameters.temperature.each do |temp| p temp.name p temp.value end p data["time-layout"]["start-valid-time"] # => "Temperature" ["35", "31", "39", "57", "67", "68", "58", "51", "48", "45", "51", "65", "73", "73", "64", "54", "58", "78", "67", "57", "60", "81", "69", "57", "58", "71", "62", "53", "55", "69", "61"] "Dew Point Temperature" ["29", "29", "32", "30", "31", "34", "36", "38", "40", "42", "43", "43", "43", "44", "45", "48", "49", "49", "51", "52", "52", "53", "53", "51", "50", "49", "48", "46", "45", "44", "45"] ["2005-04-17T02:00:00-04:00", "2005-04-17T05:00:00-04:00", "2005-04-17T08:00:00-04:00", "2005-04-17T11:00:00-04:00", "2005-04-17T14:00:00-04:00", "2005-04-17T17:00:00-04:00", "2005-04-17T20:00:00-04:00", "2005-04-17T23:00:00-04:00", "2005-04-18T02:00:00-04:00", "2005-04-18T05:00:00-04:00", "2005-04-18T08:00:00-04:00", "2005-04-18T11:00:00-04:00", "2005-04-18T14:00:00-04:00", "2005-04-18T17:00:00-04:00", "2005-04-18T20:00:00-04:00", "2005-04-19T02:00:00-04:00", "2005-04-19T08:00:00-04:00", "2005-04-19T14:00:00-04:00", "2005-04-19T20:00:00-04:00", "2005-04-20T02:00:00-04:00", "2005-04-20T08:00:00-04:00", "2005-04-20T14:00:00-04:00", "2005-04-20T20:00:00-04:00", "2005-04-21T02:00:00-04:00", "2005-04-21T08:00:00-04:00", "2005-04-21T14:00:00-04:00", "2005-04-21T20:00:00-04:00", "2005-04-22T02:00:00-04:00", "2005-04-22T08:00:00-04:00", "2005-04-22T14:00:00-04:00", "2005-04-22T20:00:00-04:00"] --------------enig8F08C48CF177F2CE04F88706 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (Cygwin) iD8DBQFCYQ8Jf6b33ts2dPkRApn9AJ473qnfjfwyJEaLy1ecAYUxjk31FgCgh2Rh XA5hkchLfwkQQHjPmMGnrlE= =cdyO -----END PGP SIGNATURE----- --------------enig8F08C48CF177F2CE04F88706--