Location: Home » METViewer Web Service
The METViewer web service is a web-server driven API that parses XML requests and returns results in an XML structure. All calls are session-less meaning that each individual call does not affect and is not affected by the results of any other call. Also, a client does not have to establish a connection with the server and all calls can be made atomically.
The web service can be accessed using the relative URL metviewer/servlet, for example http://www.dtcenter.org/met/metviewer/servlet. When the web service receives an HTTP GET request, it echoes the GET parameters and acts as a "ping" mechanism to ensure that the system is online and working. All API XML requests should be issued using an HMTL POST request with the XML request as the entire body. The XML response will indicate the type of request, and echo some information.
There are several different request types, each with a particular format of response. The METViewer client calls the different API methods in a loose ordering:
The following sections each describe a web service API function in terms of the request/response XML structure.
List the METViewer databases that are available on the system for access through the web app. The returned list reflects the contents of the mvservlet.properties file in the web app installation folder.
The list_val request is used to conditionally list the distinct values in the stat_header table of the selected database. The field whose values to list is specified in the stat_field element. There are two conditions that can be optionally included in the request: a fcst_var/stat pair and a stat_header field name with a set of values. At this point, it is worth noting that although the fields fcst_lead, fcst_valid_beg and fcst_lead_beg are not in the stat_header table of the database schema, they are considered stat_header fields from the standpoint of the METViewer servlet and client. The virtual fields inithour and validhour are considered stat_header fields.
The id element is common to the list_val and list_stat API methods, and the value specified in the request is simply echoed back to the client in the response. This feature helps the client determine which controls should be updated with the contents of the response.
Request #1: In this case, the request is for all distinct values of the stat_header field fcst_var, without any conditions.
Request #2: This conditional request is for all distinct values of vx_mask for which the fcst_var is APCP_03 and the statistic
type is categorical (the statistic CSI can be found in the database table line_data_cts). An additional stat_header field condition
stipulates that only vx_mask values whose fcst_lead is 120000 should be returned.
Response #2: The response contains only values of vx_mask for which the criteria are satisfied. This feature is useful to users
for narrowing the results of subsequent search requests. Note that, for performance reasons, time criteria such as fcst_valid_beg,
fcst_init_beg and fcst_lead does not affect the results of non-time based fields and vice versa.
The list_stat request builds a list of all statistics available in the METViewer database for the specified fcst_var. It is primarily used to construct the dep1 and dep2 portions of the plot request. Conditional criteria is not supported in list_stat requests.
Once a user has provided all the information for a complete plot specification, the plot request handles the parsing of the plot specification and generation of the plot. If a plot is successfully create from the plot specification, the location of the plot image is included in the response. If any error or warning information was captured from R during the process, it will be included in the r_error element.
(see body of plot element)
<r_error>NAs produced by integer overflow</r_error>