HELM Web Services

Introduction

The following describe the Heliophysics Event List Manager (HELM) RESTful Web services.

Target Audience

This document assumes that the reader is familar with RESTful Web service and Hypertext Transfer Protocol (HTTP) technologies.

Overview

This section contains an overview of these Web services.

Entity-Body Representations

The HTTP entity-body for both the request and response messages of these services is described by a W3C XML schema document.  The detailed description of each service describes the specific XML element from the schema that is an entity-body for the specific request or response message of the service.  In addition to the XML representation of the entity-body, all the services can return the entity-body in a mapped (with root unwrapping) JSON representation of the XML object.  A client can express their preference for a specific entity-body representation (XML or JSON) by setting the HTTP accept header (to “application/xml” or “application/json”).

Error Responses

This section provides a general description of error responses (i.e., a reponse with a code other than 200) that may be returned by any of the web services.  More details about the error response of specific services are provided in the specific service’s description.

Any entity-body returned within an error response will be XHTML (or a JSON representation of XHTML) that contains a more detailed description of the error.  Whether the entity-body is XHTML or JSON depends upon the HTTP Accept header in the request.  Not all error responses will contain an entity-body.  A client may simply display the XHTML or access the more detailed error message within the XHTML at  //p[class='ErrorMessage']/text() and  //p[class='ErrorDescription']/text().

Note that error responses may also be generated by software components other than the web services software described here in response to requests intended for these web services.  For example, a request with an invalid URI path may result in a response (e.g., 404) that is generated by the application server instead of by the web service software.  In fact, different invalid URI paths may result in an error response being generated by a proxy server, the web application server, the web service framework, or web service implementation itself.  The entity-body in an error response will vary depending upon the software component that generates the response.  A client must be prepared to deal with these differences.  To diagnose a 404 response generated by the Jersey framework, the client should add an X-Jersey-Trace-Accept HTTP request header with any value to the request.  This will cause the 404 response to have X-Jersey-Trace-nnn headers that will describe the failed attempts to match the request to a Web service implementation.

The above description of an entity-body in an error response only describes those generated by the web service implementation itself.  At the time this documentation was written, the entity-body returned in an error response from both these web services and the application server hosting them were similar.  The  //p[class='ErrorMessage']/text() value described above is accessible by //p[2]/text() in the error response from both these web services and their hosting application server.  Likewise, the //p[class='ErrorDescription']/text() value described above is accessible by //p[3]/text() in the error response from both these web services and their hosting application server. 

General Example Clients

Web Services

The table below summarizes the services which are available.  The table contains links to more detail descriptions of each operation.

Web Services

Operation
Implementation
Details
Get WADL
OPTIONS /
Details
Get About Info.
GET /about
Get Privacy Info.
GET /privacy
Get Terms of Use Info.
GET /termsOfUse
Get an Eventlist
GET /eventlists/{listname: [a-zA-Z][a-zA-Z_0-9]*}
Details
Get keywords
GET /eventlists/keywords?pattern={pattern}
Details
Search Eventlists
GET /eventlists?keyword={keyword}&xpathp={xpathp}
Details
Eventlist Union
GET /union?listUrl={listUrl}
Details
Eventlist Intersection
GET /intersection?listUrl={listUrl}
Details
Shift Times of Eventlist

GET /shiftTimes?quantity={quantity}&listUrl={listUrl}
Details
POST /shiftTimes?quantity={quantity}
Details
Adjust TimeSpans of Eventlist

GET /adjustTimeSpans?quantity={quantity}&listUrl={listUrl}
Details
POST /adjustTimeSpans?quantity={quantity}
Details

Get WADL

This service provides the Web Application Description Language (WADL) for these Web services.

Example

Below is an example client request to this service and the results.

$ curl —request OPTIONS http://helm.gsfc.nasa.gov/WS/helm/1/ | xmllint —format -



  
  
    
      
        
        
          
            
            
          
        
      
      
        
          
            
          
          
            
            
          
        
      
      
        
          
            
          
          
            
            
          
        
      
      
        
          
            
            
          
          
            
            
            
          
        
      
      
        
          
            
            
          
          
            
            
          
        
        
          
            
            
            
          
          
            
            
          
        
      
      
        
          
            
            
          
          
            
            
          
        
        
          
            
            
            
          
          
            
            
          
        
      
    
  

Get About

Get Privacy

Get Terms Of Use


Get an Eventlist

Retrieves the specified Eventlist.

HTTP Method
GET
URI
/eventlists/{listname:[a-zA-Z][a-zA-Z_0-9]*}
Significant Request Headers
Accept
application/xml
application/json
If-Modified-Since
Request Entity
none
Significant Response Headers
Last-Modified
Reponse Entity
Content-Type: application/xmlAs specified by Eventlist in helm.xsd
Content-Type: application/jsonJSON representation of Eventlist in helm.xsd
Most Likely
Response Codes



200
Ok
304
Not Modified
404
Not Found

Where:

Get Keywords

Retrieves Eventlist keyword values.

HTTP Method
GET
URI
/eventlists/keywords?pattern={pattern}
Significant Request Headers
Accept
application/xml
application/json
application/xhtml+xml
If-Modified-Since
Request Entity
none
Significant Response Headers
Last-Modified
Reponse Entity
Content-Type: application/xmlAs specified by KeywordDescriptions in helm.xsd
Content-Type: application/jsonJSON representation of KeywordDescriptions in helm.xsd
Most Likely
Response Codes



200
Ok
304
Not Modified
404
Not Found

Where:

Search Eventlists

Searchs all Eventlists for those that satisfies the given criteria and returns a description those Eventlists.

HTTP Method
GET
URI
/eventlists?keyword={keyword}&xpathp={xpathp}
Significant Request Headers
Accept
application/xml
application/json
application/xhtml+xml
Request Entity
none
Reponse Entity
Content-Type: application/xmlAs specified by EventlistDescriptions in helm.xsd
Content-Type: application/jsonJSON representation of EventlistDescriptions in helm.xsd
Content-Type: application/xhtml+xml
A very basic XHTML page with an unordered list (
    ) containing the spase:Name values and an href link to the actual Eventlist.  This is intended primarily for debugging and not expected to be very useful for general clients.
Most Likely
Response Codes



200
0
400
0
404

Where:

Eventlist Union

Performs a union of the specified Eventlists and returns the resulting Eventlist.

HTTP Method
GET
URI
/union?listUrl={listUrl}
Significant Request Headers
Accept
application/xml
application/json
Request Entity
none
Reponse Entity
Content-Type: application/xmlAs specified by Eventlist in helm.xsd
Content-Type: application/jsonJSON representation of Eventlist in helm.xsd
Most Likely
Response Codes



200
400
404

Where:

Eventlist Intersection

Performs an intersection of the specified Eventlists and returns the resulting Eventlist.

HTTP Method
GET
URI
/intersection?listUrl={listUrl}
Significant Request Headers
Accept
application/xml
application/json
Request Entity
none
Reponse Entity
Content-Type: application/xmlAs specified by Eventlist in helm.xsd
Content-Type: application/jsonJSON representation of Eventlist in helm.xsd
Most Likely
Response Codes



200
0
400
0
404

Where:

Shift Times of Eventlist (GET)

Adds the specified quantity to each StartDate and StopDate within the given Eventlist and returns the resulting Eventlist.

HTTP Method
GET
URI
/shiftTimes?listUrl={listUrl}&quantity={quantity}
Significant Request Headers
Accept
application/xml
application/json
Request Entity
none
Reponse Entity
Content-Type: application/xmlAs specified by Eventlist in helm.xsd
Content-Type: application/jsonJSON representation of Eventlist in helm.xsd
Most Likely
Response Codes



200
400
404

Where:

Shift Times of Eventlist (POST)

Adds the specified quantity to each StartDate and StopDate within the given Eventlist and returns the resulting Eventlist.

HTTP Method
POST
URI
/shiftTimes?quantity={quantity}
Significant Request Headers
Accept
application/xml
application/json
Request Entity
As specified by Eventlist in helm.xsd
Reponse Entity
Content-Type: application/xmlAs specified by Eventlist in helm.xsd
Content-Type: application/jsonJSON representation of Eventlist in helm.xsd
Most Likely
Response Codes



200
400
404

Where:

Adjust TimeSpans of Eventlist (GET)

Symmetrically widens or narrows all TimeSpan values in the specified Eventlist by the specified quantity and returns the resulting Eventlist.

HTTP Method
GET
URI
/adjustTimeSpans?listUrl={listUrl}&quantity={quantity}
Significant Request Headers
Accept
application/xml
application/json
Request Entity
none
Reponse Entity
Content-Type: application/xmlAs specified by Eventlist in helm.xsd
Content-Type: application/jsonJSON representation of Eventlist in helm.xsd
Most Likely
Response Codes



200
400
404

Where:

Adjust TimeSpans of Eventlist (POST)

Symmetrically widens or narrows all TimeSpan values in the provided Eventlist by the specified quantity and returns the resulting Eventlist.

HTTP Method
POST
URI
/adjustTimeSpans?quantity={quantity}
Significant Request Headers
Accept
application/xml
application/json
Request Entity
As specified by Eventlist in helm.xsd
Reponse Entity
Content-Type: application/xmlAs specified by Eventlist in helm.xsd
Content-Type: application/jsonJSON representation of Eventlist in helm.xsd
Most Likely
Response Codes



200
400
404

Where:

Questions/Comments

Questions or comments concerning these Web services should be sent to HELM Feedback.