XML
NEW assig.docx
DUE 5\17
Objective:
Input:
· XML request containing a SOAP message which inputs appropriate information to the web service as required.
Output:
· XML response containing a SOAP message with values of appropriate requested parameters.
· XSLT table for the Web service method derived from the SOAP response message.
Specification:
· The SOAP message requests information from the National Digital Forecast Database (NDFD) Web Service at:
http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl by specifying the appropriate parameters for the method:
NDFDgenByDay:
|
Input Name |
Type |
Example |
Description |
|
latitude |
Decimal |
34.23 |
The WGS84 latitude of the point for which you want NDFD data. North latitude is positive. |
|
longitude |
Decimal |
-118.52 |
The WGS84 longitude of the point for which you want NDFD data. West longitude is negative. |
|
startDate |
XML Date String |
2016-05-11 |
The beginning day for which you want NDFD data. If the string is empty, the start date is assumed to be the earliest available day in the database. This input is only needed if one wants to shorten the time window data is to be retrieved for (less than entire 7 days worth), e.g. if user wants data for days 2-5. |
|
numDays |
Integer |
5 |
The number of days worth of NDFD data you want. Default will be all available data in the database. This input is only needed if one wants to shorten the time window data is to be retrieved for (less than entire 7 days worth), e.g. if user wants data for days 25. |
|
Unit |
String |
e |
The unit data is to be retrieved in. The default value is U.S. Standard, or English units ("e"). A value of "m" will return data in Metric, or SI units (The International System of Units). If the string is empty, data will be returned in U.S. standard units, thus the input is only needed for metric conversion. |
|
format |
String |
12 hourly |
There are two formats. The “24 hourly” format returns NDFD data summarized for a 24 hour period running from 6:00 AM to 6:00 AM. The “12 hourly” format summarizes NDFD data into two 12 hour periods per day that run from 6:00 AM to 6:00 PM and 6:00 PM to 6:00 AM |
· Use either: (i) the SOAP message generator: http://www.soapclient.com/soapmsg.html , or (ii) the SOAPui application (in the lab or downloaded from http://soapui.org to a home computer) to generate a template SOAP message based on the above WSDL file and the NDFDgenByDay method, then fill in the placeholders between the appropriate XML tags before executing to generate a response SOAP message.
· Use the XSLT display editor to display each appropriate table by replacing the XML and XSLT code:
http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog . Note: this requires stripping off (i) everything before the <data> tag; (ii) the <moreWeatherInformation>…</moreWeatherInformation> tags and values
(the “&” causes trouble); (iii) everything after the </data> tag. This makes <data> the root element in the XML file.
· Hint: to get the value of an attribute, use <xsl:value of select="path to tag/@name_of_attribute/>
· Hint: to select a particular set of times, filter the selection, use <xsl:for-each select="data/time-layout[layout-key=’…’]">, replacing … with the value of the element layout-key
· To display an image in XSLT, use <img><xsl:attribute name="src"><xsl:value-of select="URL"/></xsl:attribute> where URL represents the appropriate hyperlink.
· To force a newline, one way is to create a blank table: <table><tr></tr></table>, repeating for each blank line desired.
What to turn in:
· A zipped file (tech2_yourlastname.zip) containing both the modified XML code (tech2_yourlastname.xml) generated from the SOAP response method and the XSLT code (tech2_yourlastname.xsl) submitted via Moodle to the appropriate lab section.
5-Day Weather Forecast for GPS Location (34.23 , -118.52)
|
Temperature |
Wednesday |
Thursday |
Friday |
Saturday |
Sunday |
|||||
|
Daily Maximum Temperature |
82 |
88 |
83 |
78 |
78 |
|||||
|
Daily Minimum Temperature |
54 |
56 |
57 |
56 |
56 |
|||||
|
Conditions |
Tuesday Night |
Wednesday |
Wednesday Night |
Thursday |
Thursday Night |
Friday |
Friday Night |
Saturday |
Saturday Night |
Sunday |
|
12 Hourly Probability of Precipitation |
3 |
2 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
0 |
|
Weather Type, Coverage, and Intensity |
Mostly Clear |
Mostly Sunny |
Mostly Clear |
Mostly Sunny |
Mostly Clear |
Mostly Sunny |
Patchy Fog |
Mostly Sunny |
Patchy Fog |
Mostly Sunny |
|
Conditions Icons |
|
|
|
|
|
|
|
|
|
|
OLD proj/Tech Assignment 2 Description.pdf
OLD proj/tech2_dohle.xml
point1 k-p24h-n5-1 2015-05-15T06:00:00-04:00 2015-05-15T18:00:00-04:00 2015-05-16T06:00:00-04:00 2015-05-16T18:00:00-04:00 2015-05-17T06:00:00-04:00 2015-05-17T18:00:00-04:00 2015-05-18T06:00:00-04:00 2015-05-18T18:00:00-04:00 2015-05-19T06:00:00-04:00 2015-05-19T18:00:00-04:00 k-p24h-n5-2 2015-05-14T18:00:00-04:00 2015-05-15T06:00:00-04:00 2015-05-15T18:00:00-04:00 2015-05-16T06:00:00-04:00 2015-05-16T18:00:00-04:00 2015-05-17T06:00:00-04:00 2015-05-17T18:00:00-04:00 2015-05-18T06:00:00-04:00 2015-05-18T18:00:00-04:00 2015-05-19T06:00:00-04:00 k-p12h-n10-3 2015-05-14T18:00:00-04:00 2015-05-15T06:00:00-04:00 2015-05-15T06:00:00-04:00 2015-05-15T18:00:00-04:00 2015-05-15T18:00:00-04:00 2015-05-16T06:00:00-04:00 2015-05-16T06:00:00-04:00 2015-05-16T18:00:00-04:00 2015-05-16T18:00:00-04:00 2015-05-17T06:00:00-04:00 2015-05-17T06:00:00-04:00 2015-05-17T18:00:00-04:00 2015-05-17T18:00:00-04:00 2015-05-18T06:00:00-04:00 2015-05-18T06:00:00-04:00 2015-05-18T18:00:00-04:00 2015-05-18T18:00:00-04:00 2015-05-19T06:00:00-04:00 2015-05-19T06:00:00-04:00 2015-05-19T18:00:00-04:00 k-p5d-n1-4 2015-05-14T18:00:00-04:00 2015-05-19T18:00:00-04:00 Daily Maximum Temperature 75 85 87 77 76 Daily Minimum Temperature 52 62 68 69 68 12 Hourly Probability of Precipitation 0 13 18 35 31 37 37 49 55 49 Weather Type, Coverage, and Intensity Conditions Icons http://www.nws.noaa.gov/weather/images/fcicons/nsct.jpg http://www.nws.noaa.gov/weather/images/fcicons/bkn.jpg http://www.nws.noaa.gov/weather/images/fcicons/nbkn.jpg http://www.nws.noaa.gov/weather/images/fcicons/tsra40.jpg http://www.nws.noaa.gov/weather/images/fcicons/ntsra30.jpg http://www.nws.noaa.gov/weather/images/fcicons/tsra40.jpg http://www.nws.noaa.gov/weather/images/fcicons/ntsra40.jpg http://www.nws.noaa.gov/weather/images/fcicons/tsra50.jpg http://www.nws.noaa.gov/weather/images/fcicons/hi_nshwrs60.jpg http://www.nws.noaa.gov/weather/images/fcicons/tsra50.jpg
OLD proj/tech2_dohle.xsl
5-Day Weather Forecast for GPS Location ( , ) Temperature Daily Maximum Temperature Daily Minimum Temperature Conditions 12 Hourly Probability of Precipitation Weather Type, Coverage, and Intensity