280 likes | 447 Views
Exploiting XML and a SOAP Service to Disseminate National Weather Service Digital Forecast Data. John L. Schattel Meteorological Development Laboratory NOAA WebShop 2004 July 27 - 29, 2004. The NWS Strategic Plan.
E N D
Exploiting XML and a SOAP Service to Disseminate National Weather Service Digital Forecast Data John L. SchattelMeteorological Development Laboratory NOAA WebShop 2004July 27 - 29, 2004
The NWS Strategic Plan • “…evolving our services from a text-based paradigm to one based on making National Weather Service (NWS) information available quickly, efficiently, and in convenient and understandable forms…” and “…by taking advantage of existing and emerging technologies to disseminate this information…”
Overview • The value of digital data • NWS digital forecast database • How it is created • What it contains • Digital Weather Markup Language (DWML) • XML Overview • DWML Data Model • A SOAP service to disseminate NWS digital data • SOAP service introduction • National Digital Forecast Database (NDFD) Web Service
Potential Uses of NWS Data • Weather information along a path • Text generation in more than one language • Forecasts for vehicles and hand-held devices with GPS • Controls for smart appliances (e.g., heating, cooling, irrigation) .TONIGHT...CLEAR. LOW IN THE MID 30S. LIGHT WIND EARLY BECOMING SOUTHWEST 10 TO 15 MPH AFTER MIDNIGHT. Pre-digital Age …
Improved spatial resolution Enhanced temporal coverage Digital Age Data
NDFD Data Flow Local Grids NYC NWS 7-Day Digital Forecast Local Grids Mt Holly NDFD (Mosaic) Local Grids Sterling
Current NDFD Contents • Daytime maximum and nighttime minimum temperature • Probability of Precipitation (12 hour) • Significant weather • Sky cover • Temperature • Dewpoint temperature • Wind direction and speed • Precipitation amount (QPF) • Snow amount • Wave height
NDFD Resolution • Spatial resolution: • - 5 km grids for now • - 2.5 km grids when hardware allows • Temporal resolution: • - 3 hourly for days 1-3 • - 6 hourly for days 4-7 • Update frequency: every hour
Products Internet Users NWS Web Farm Services NDFD Data Flow Local Grids NYC NWS 7-Day Digital Forecast Local Grids Mt Holly NDFD (Mosaic) Local Grids Sterling
Text Graphics Tonight: Scattered showers before 10pm.Chance for precipitation is 30%. Partly cloudy, with a low near 29. West wind 6 to 9 mph increasing to between 15 and 18 mph. Friday: Partly cloudy, with a high near 49. Breezy, with a west wind between 14 and 21 mph. Friday Night: Partly cloudy, then gradually becoming clear, with a low around 23. West wind between 8 and 14 mph. Saturday: Sunny, with a high around 50.Saturday Night: Mostly clear, with a low around 26. GRIB2 YGCC00 KWBN 171951 GRIBQAwAAVJVS05XQwIBAABgChIMNgFCVEZOSFRKQTk4IEtOV0MgMTgxMjAwDQ0KR1JJQgA9sgEAABwCOkbygAtpAAJgChIMAAEAAAAAAAAUAAABAAAgAP8AAIUAaQAPoAFnYIAA2sACaTAB9AH0QAAAAAAAPWoDAABDpNrkCbzfL/gcHhcBdrTT5XH55ZcBjcdhLhYK5W7HeMRjsfjsZisRhsNh87777 YGCD00 KWBN 171951 GRIBRiMRiicTisPeK/RZbIpfS7RecFhsPiMVi8XisRhsJgsFgsHhMLhcJg8HhMLhcNhsNhsPh8RiMTicVi8dkMjkMfjsfj8djsfk8tmc7oFoM7msvlMjjsbjcfkMjkclkcjkMfjsfkMcnk8jj8fj8djcbj8nlsznM/odBns3mctksfjcbjsfkclkslkchj8djsfkcllMpkcTgr3fb9gcJhr3Z61U6lX7thsXjMTd6vR6ZVLHecLicXjcbjcViMPicTicTicTicTicVi8R7777 NDFD Products http://www.nws.noaa.gov/forecasts/graphical/
NDFD Services DWML SOAP Service <dwml xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <head> <product concise-name="time-series"> <creation-date>2004-02-13T21:29:11Z</creation-date> </product> <source> <production-center>MDL</production-center> </source> </head> <data> <parameters> <temperature units="Fahrenheit"> <value>45</value> <value>31</value> <value>29</value> <value>37</value> <value>41</value> <value>41</value> <value xsi:nil="true" /> </temperature> </parameters> </data> </dwml> User Selectable GRIB2 Data
XML Rules • Document needs one root element • Elements come in start and end pairs • XML is case sensitive • Attributes must appear within quotes • Elements must not overlap (only nested) XML Overview Extensible Markup Language (XML) n. 1. Internet standard for data exchange. 2. Language to create other languages. 3. A way to provide NDFD data <dwml xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <head> <product concise-name="time-series"> <creation-date>2004-02-13T21:29:11Z</creation-date> </product> <source> <production-center>MDL</production-center> </source> </head> <data> <parameters> <temperature units="Fahrenheit"> <value>45</value> <value>31</value> <value>29</value> <value>37</value> <value>41</value> <value>41</value> <value xsi:nil="true" /> </temperature> </parameters> </data> </dwml> XML Schema + SAX, DOM, XSLT TODAY: HIGH TEMP OF 45 F. TOMORROW: HIGH TEMP OF 31 F SUNDAY: HIGH TEMP OF 29 F MONDAY: HIGH TEMP OF 37 F TUESDAY: HIGH TEMP OF 41 F WEDNESDAY: HIGH TEMP OF 41 F
XML Overview • Existing technology • XML is widely used (W3C specification) • De Facto standard for internet data exchange • Infrastructure exists (UDDI, validators, XML Schema) • Facilitates additional processing • XML tools (XSLT, SAX, DOM) facilitate value added applications • Web application developers familiar with tools • Schema precisely defines a language
NDFD Data Cube Weather Parameters Space Time
DWML Data Model <dwml> <head> <product /> <source /> </head> <data> <location /> <time-layout /> <parameters /> </data> </dwml> more follows = … zero or one = ? zero or more = * one or more = + Element Attribute version … … … … …
DWML Data Model <dwml> <head> <product /> <source /> </head> <data> <location /> <time-layout /> <parameters /> </data> </dwml> more follows = … zero or one = ? zero or more = * one or more = + latitude longitude summarization ? Example
DWML Data Model <dwml> <head> <product /> <source /> </head> <data> <location /> <time-layout /> <parameters /> </data> </dwml> more follows = … zero or one = ? zero or more = * one or more = + time-coordinate + * period-name ? Example
DWML Data Model <dwml> <head> <product /> <source /> </head> <data> <location /> <time-layout /> <parameters /> </data> </dwml> more follows = … zero or one = ? zero or more = * one or more = + applicable-location * * * * * … type units time-layout type units time-layout type units time-layout type units time-layout type units time-layout
DWML Data Model <dwml> <head> <product /> <source /> </head> <data> <location /> <time-layout /> <parameters /> </data> </dwml> more follows = … zero or one = ? zero or more = * one or more = + * ? … type units time-layout type units time-layout Example
DWML Data Model <dwml> <head> <product /> <source /> </head> <data> <location /> <time-layout /> <parameters /> </data> </dwml> more follows = … zero or one = ? zero or more = * one or more = + applicable-location type units time-layout Example NOTE:This structure applies to precipitation, probability-of-precipitation, wind-speed, direction, cloud amount and humidity
XML on the Move Data Broker (UDDI) WSDL WSDL Internet SOAP Request SOAP Request Data Consumer (Client) Data Provider (Server) Data SOAP Response SOAP Response Communicating Process Discovery (UDDI) Description (WSDL/Schema) Messaging (SOAP) Transport (HTTP)
User Address SOAP (latitude/longitude*) End User (Public) Customer or Partner NWS Web Farm Custom Display SOAP (DWML) • Potential Applications: • NWS: Fire Weather Spot Forecasts • Public: Park forecasts for recreation.gov • Private: Smart appliances NWS NDFD Web Service *Optional inputs include which times and weather parameters the user wants or the name of a pre-defined set of parameters (glance).
NDFD Web Service Demo • NDFD XML • User’s client creates SOAP service input • The location (latitude/longitude) • Product name (“time-series” or “glance”) • Which weather elements • A start and end date/time • User’s client creates & sends a SOAP request • NDFD SOAP server returns DWML/data • User application processes DWML http://www.nws.noaa.gov/forecasts/xml/sample_products/browser_interface/ndfdXML.htm
NDFD Web Service Demo • Meteogram Example • User’s client creates SOAP service input • Client uses WSDL to create SOAP request • NDFD SOAP server returns DWML • Client uses SAX to parse the DWML • Client uses VH Graph to create meteogram http://www.nws.noaa.gov/forecasts/xml/sample_products/meteogram/DWML_graph.htm
Implementing a Web Service • Deploying web service • Install web server (Apache) • Install SOAP service software (NuSOAP) • Deploy prototype service (NWSI 10-506 ) • Created Service Description Document • Established service home page • Collect user feedback • Users are encouraged to take survey • Partners Workshop • Implement “official” service
.TONIGHT...CLEAR. LOW IN THE MID 30S. LIGHT WIND EARLY BECOMING NWS forecast data available quickly, efficiently, and in convenient and understandable forms Pre-digital Age … Digital Age Is Here
Acronyms • DOM – Document Object Model • DWML - Digital Weather Markup Language • GFE – Grid Forecast Editor • NDFD - National Digital Forecast Database • NWS – National Weather Service • SAX – Simple API for XML • SOAP - Simple Object Access Protocol • UDDI - Universal Description, Discovery, and Integration • WSDL - Web Service Description Language • XML - Extensible Markup Language • XSLT – Extensible Stylesheet Language Transformations
References • NDFD XML Home Page: http://www.nws.noaa.gov/forecasts/xml/ • NDFD XML Service • Service: http://www.nws.noaa.gov/forecasts/xml/SOAP_server/ndfdXMLserver.php • WSDL: http://www.nws.noaa.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl • Schema: http://www.nws.noaa.gov/forecasts/xml/DWMLgen/schema/DWML.xsd • Sample Products: http://weather.gov/forecasts/xml/sample_products/ndfdXML.tar • NDFD Home Page: http://www.nws.noaa.gov/ndfd/index.htm • NuSOAP: http://dietrich.ganx4.com/nusoap/index.php • SAX: http://sax.sourceforge.net/ • SOAP: http://www.w3.org/TR/soap/ • UDDI - http://www.uddi.org/ • VH Graph: http://codingtheweb.users.phpclasses.org/browse/package/257.html • WSDL - http://www.w3.org/TR/wsdl • XML - http://www.w3.org/XML/ • XSLT – http://www.w3.org/TR/xslt