United States Department of Veterans Affairs
Local Weather
Overview
The localWeather web service obtains current weather information for a valid 5-digit zip code from the National Weather Service. There are four methods available in this web service. They all return the same data only in varying formats. To improve performance, only request the specific weather information you need. For example, if you are developing a page that will only display the current conditions then you should set 'forecast' and 'radsat' to FALSE. This will reduce the amount of parsing required to collect the necessary data. NOTE: When using this web service, be sure to credit the National Weather Service (http://www.nws.noaa.gov) as the source of the information.
  • The ConditionsAndForecast_array method returns data in a structure. If forecast information is being returned the forecast field of the structure will be an array.
  • The ConditionsAndForecast_query method returns data in a structure. If forecast information is being returned the forecast field of the structure will be a ColdFusion query result set.
  • The ConditionsAndForecast_xml method returns data in an XML packet passed back encapsulated in a WDDX packet.
  • The ConditionsAndForecast_xmlString method returns data in an XML packet passed back as a string.
  • The ConditionsAndForecast_wddx method returns data in a structure. If forecast information is being returned the forecast field of the structure will be a WDDX packet.
top of page

Demonstration
Use the links below to view a visual representation of the data return from the web service.

Demo the ConditionsAndForecast_array method where ZIPCODE=21704
Demo the ConditionsAndForecast_query method where ZIPCODE=21704
Demo the ConditionsAndForecast_xml method where ZIPCODE=21704
Demo the ConditionsAndForecast_xmlString method where ZIPCODE=21704
Demo the ConditionsAndForecast_wddx method where ZIPCODE=21704

top of page

Samples
The methods in this web service can be used for a variety of purposes. Below are a few samples:
  • VISN 5 Weather - You can use one of the ConditionsAndForecast methods to create a weather center for your organization. This demo uses the ConditionsAndForecast_query method to create a weather page for VISN 5. For the purposes of the demo the application has been modified to only reflect the weather for the Cambridge Outpatient Clinic (zipcode=21613).( Source code - ColdFusion template that uses CFINVOKE to consume the web service. )
top of page

Summary
Below is a high-level look at the web service and the methods it has to offer for public consumption.
hierarchy: webservices.weather.localWeather
location: http://www.va.gov/webservices/weather/localWeather.cfc
wsdl: http://www.va.gov/webservices/weather/localWeather.cfc?wsdl
methods: ConditionsAndForecast_array, ConditionsAndForecast_query, ConditionsAndForecast_xml, ConditionsAndForecast_xmlString, ConditionsAndForecast_wddx
output: sForecast structure, aWeather structure, qWeather structure, wWeather structure, xWeather XML packet
status: Definitions are available for each of the possible web service result status codes
version: 1.0

top of page

Interface Details
Below is a detail look at the methods contained in this web service, the output format provided by those methods and the possible status conditions that can result from consuming this web service.

 methods
ConditionsAndForecast_array
remote struct ConditionsAndForecast_array (required boolean conditions, required boolean radsat, required boolean forecast, required string zipcode, required string license)

This method queries the National Weather Service for the current weather conditions of the supplied zip code. The forecast field of the structure will contain an array with each forecast representing a record of the array.

Input:
conditions: [boolean, required] - True/False indicator for whether the current conditions should be returned.
radsat: [boolean, required] - True/False indicator for whether or not the radar and satellite image information should be returned.
forecast: [boolean, required] - True/False indicator for whether the forecast should be returned.
zipcode: [string, required] - The 5-digit zip code of the location to retrieve the current conditions and forecast for.
license: [string, required] - The license key issued by the VA Web Solutions Office that is required to use the web service.
Output:
aWeather array structure
ConditionsAndForecast_query
remote struct ConditionsAndForecast_query (required boolean conditions, required boolean radsat, required boolean forecast, required string zipcode, required string license)

This method queries the National Weather Service for the current weather conditions of the supplied zip code. The forecast field of the structure will contain a ColdFusion query result set with each forecast representing a record.

Input:
conditions: [boolean, required] - True/False indicator for whether the current conditions should be returned.
radsat: [boolean, required] - True/False indicator for whether or not the radar and satellite image information should be returned.
forecast: [boolean, required] - True/False indicator for whether the forecast should be returned.
zipcode: [string, required] - The 5-digit zip code of the location to retrieve the current conditions and forecast for.
license: [string, required] - The license key issued by the VA Web Solutions Office that is required to use the web service.
Output:
qWeather ColdFusion query structure
ConditionsAndForecast_xml
remote string ConditionsAndForecast_xml (required boolean conditions, required boolean radsat, required boolean forecast, required string zipcode, required string license)

This method queries the National Weather Service for the current weather conditions of the supplied zip code. Data is returned in a string which is encapsulated inside a WDDX packet.

Input:
conditions: [boolean, required] - True/False indicator for whether the current conditions should be returned.
radsat: [boolean, required] - True/False indicator for whether or not the radar and satellite image information should be returned.
forecast: [boolean, required] - True/False indicator for whether the forecast should be returned.
zipcode: [string, required] - The 5-digit zip code of the location to retrieve the current conditions and forecast for.
license: [string, required] - The license key issued by the VA Web Solutions Office that is required to use the web service.
Output:
xWeather structure (returned as a string encapsulated in a WDDX packet)
ConditionsAndForecast_xmlString
remote string ConditionsAndForecast_xmlString (required boolean conditions, required boolean radsat, required boolean forecast, required string zipcode, required string license)

This method queries the National Weather Service for the current weather conditions of the supplied zip code. Data is returned in a string.

Input:
conditions: [boolean, required] - True/False indicator for whether the current conditions should be returned.
radsat: [boolean, required] - True/False indicator for whether or not the radar and satellite image information should be returned.
forecast: [boolean, required] - True/False indicator for whether the forecast should be returned.
zipcode: [string, required] - The 5-digit zip code of the location to retrieve the current conditions and forecast for.
license: [string, required] - The license key issued by the VA Web Solutions Office that is required to use the web service.
Output:
xWeather structure (returned as a string)
ConditionsAndForecast_wddx
remote struct ConditionsAndForecast_wddx (required boolean conditions, required boolean radsat, required boolean forecast, required string zipcode, required string license)

This method queries the National Weather Service for the current weather conditions of the supplied zip code. The forecast field of the structure will contain a WDDX packet.

Input:
conditions: [boolean, required] - True/False indicator for whether the current conditions should be returned.
radsat: [boolean, required] - True/False indicator for whether or not the radar and satellite image information should be returned.
forecast: [boolean, required] - True/False indicator for whether the forecast should be returned.
zipcode: [string, required] - The 5-digit zip code of the location to retrieve the current conditions and forecast for.
license: [string, required] - The license key issued by the VA Web Solutions Office that is required to use the web service.
Output:
wWeather WDDX structure

top of page

 output format
sForecast structure
sForecast.wDay: string - The timeframe that the forecast is for (i.e Today, Tonight, Friday, etc)
sForecast.imageURL: string - The URL for the image relating to the forecast
sForecast.imageHeight: string - The height (in pixels) of the forecast image
sForecast.imageWidth: string - The width (in pixels) of the forecast image
sForecast.brief: string - A brief summary of the forecast
sForecast.detail: string - The complete forecast
aWeather structure
aWeather.status: string - The result status of the web service call
aWeather.zipcode: string - The zip code weather was returned for
aWeather.location: string - The city/state the weather was returned for
aWeather.recordedAt: string - Location where the conditions were recorded at
aWeather.recordedDateTime: string - The date and time the conditions were recorded
aWeather.observation: string - The visual appearance of the weather at the time of recording
aWeather.temperature: string - The temperature at the time of recording
aWeather.humidity: string - The humidity level at the time of recording
aWeather.windspeed: string - The wind speed at the time of recording
aWeather.barometer: string - The barometric pressure at the time of recording
aWeather.dewpoint: string - The dewpoint at the time of recording
aWeather.seasonalText: string - The season specific weather condition (i.e. wind chill, heat index)
aWeather.seasonalTemp: string - The season specific temperature
aWeather.radarImageURL: string - The URL of the radar image
aWeather.radarImageHeight: string - The height (in pixels) of the radar image
aWeather.radarImageWidth: string - The width (in pixels) of the radar image
aWeather.satelliteImageURL: string - The URL of the satellite image
aWeather.satelliteImageHeight: string - The height (in pixels) of the satellite image
aWeather.satelliteImageWidth: string - The width in (pixels) of the satellite image
aWeather.forecasts: array containing sForecast structure records
qWeather structure
qWeather.status: string - The result status of the web service call
qWeather.zipcode: string - The zip code weather was returned for
qWeather.location: string - The city/state the weather was returned for
qWeather.recordedAt: string - Location where the conditions were recorded at
qWeather.recordedDateTime: string - The date and time the conditions were recorded
qWeather.observation: string - The visual appearance of the weather at the time of recording
qWeather.temperature: string - The temperature at the time of recording
qWeather.humidity: string - The humidity level at the time of recording
qWeather.windspeed: string - The wind speed at the time of recording
qWeather.barometer: string - The barometric pressure at the time of recording
qWeather.dewpoint: string - The dewpoint at the time of recording
qWeather.seasonalText: string - The season specific weather condition (i.e. wind chill, heat index)
qWeather.seasonalTemp: string - The season specific temperature
qWeather.radarImageURL: string - The URL of the radar image
qWeather.radarImageHeight: string - The height (in pixels) of the radar image
qWeather.radarImageWidth: string - The width (in pixels) of the radar image
qWeather.satelliteImageURL: string - The URL of the satellite image
qWeather.satelliteImageHeight: string - The height (in pixels) of the satellite image
qWeather.satelliteImageWidth: string - The width in (pixels) of the satellite image
qWeather.forecasts: ColdFusion query result set containing the same fields as sForecast structure records
wWeather structure
wWeather.status: string - The result status of the web service call
wWeather.zipcode: string - The zip code weather was returned for
wWeather.location: string - The city/state the weather was returned for
wWeather.recordedAt: string - Location where the conditions were recorded at
wWeather.recordedDateTime: string - The date and time the conditions were recorded
wWeather.observation: string - The visual appearance of the weather at the time of recording
wWeather.temperature: string - The temperature at the time of recording
wWeather.humidity: string - The humidity level at the time of recording
wWeather.windspeed: string - The wind speed at the time of recording
wWeather.barometer: string - The barometric pressure at the time of recording
wWeather.dewpoint: string - The dewpoint at the time of recording
wWeather.seasonalText: string - The season specific weather condition (i.e. wind chill, heat index)
wWeather.seasonalTemp: string - The season specific temperature
wWeather.radarImageURL: string - The URL of the radar image
wWeather.radarImageHeight: string - The height (in pixels) of the radar image
wWeather.radarImageWidth: string - The width (in pixels) of the radar image
wWeather.satelliteImageURL: string - The URL of the satellite image
wWeather.satelliteImageHeight: string - The height (in pixels) of the satellite image
wWeather.satelliteImageWidth: string - The width in (pixels) of the satellite image
wWeather.forecasts: string containing the search results in a WDDX packet.
xWeather XML packet
View the xWeather Document Type Declaration (DTD)

top of page

 status conditions
Code Definition
0 Web service method executed successfully
-1 Web service was unable to obtain data from the National Weather Service
-2 Boolean indicator for conditions not supplied
-3 Boolean indicator for radar and satellite images not supplied
-4 Boolean indicator for forecast not supplied
-5 At least 1 of the 3 boolean indicators must be True
-6 No zip code was supplied
-7 Invalid zip code format (#####)
-998 Currently unable to validate license
-999 Invalid license

top of page