Response Documents

Whenever a client submits a perform document to a data service, a response document will be received in return. A response document describes the status of execution of a perform document and also identifies the session that the request was joined to. Depending on the activities specified in the perform document, the response document may also contain result data such as the XML-encoded results of a database query.

Document Structure

The client can parse the response document to determine whether the request completed successfully and extract any content that may be of interest. The root element of a response document is a element. The first child element is a element identifying the session that the request was joined to for processing. The second child element is a element describing the status of execution of the request. The remainder of the content of this document depends on the activities used within the original perform document.


A response document contains result elements corresponding to parts of the perform document.

Recall that perform documents contining end-points, such as myActivityOutput in the figure above, are processed synchronously. This means that the response document is only returned to the client once processing of the request is complete. For requests of this form, the response document will contain a element corresponding to each activity and end-point of the perform document. So the response document in the figure above contains two result elements, one for the activity named myActivity and the other for the end-point named myActivityOutput

Each element will contain a status attribute describing the status of execution of the activity or end-point. Those that represent end-points will also contain the result data that was written to that end-point during the activity processing. Result data is embedded within child CDATA sections. The structure and format of result data depends on the implementation of the activity producing the data. For example, the sqlResultsToXML activity produces WebRowSet XML data.

If a perform document contains no end-points, then the activities described within it can be processed asynchronously. Since there is no result data to embed with the response document, the response document can be returned to the client as soon as the request has been initialised. A response document corresponding to this form of request will contain only the and elements and no elements.

Example

The following perform document sends an SQL query to a relational database and transforms the results into WebRowSet XML. It will be processed synchronously because there is an end-point named webRowSetOutput.



  
    Perform a simple SELECT statement then transform the results
    into WebRowSet XML.
  
  myQuery"/>
    select * from littleblackbook where id=10
    
  
  
    
    webRowSetOutput"/>
  

If the request completes successfully, then a response document similar to the one shown below will be returned to the client:



  
  
  
  
  
    
      
      ...
      
         10
         John Smith
         123 Some Lane, AnyTown
         0131-555-1234
      
      ...
    ]]>
  

Notice that the result data has been enclosed within a CDATA section. The Client Toolkit APIs provide a simple way to access this data through the conventional java.sql.ResultSet interface.

Specification

A response document consists of a root response element belonging to the namespace https://ogsadai.org.uk/namespaces/2005/10/types. This element contains:

XML Schema

OGSA-DAI/schema/ogsadai/xsd/response.xsd