A response document describes the status of execution of a perform document and may also contain result data. Whenever an OGSA-DAI service receives a perform document it will return a response document to the client. The client can then parse the response document to determine whether the request has completed successfully and extract any content of interest. The root element of a response document is a response element. The first child is a request element describing the status of execution of the request.
A response document corresponding to a synchronous perform document will also describe the status of execution of every activity in the perform document, as well as containing any result data. Activity status and result data are expressed within the response document using result elements. There will be one result element for each activity and end-point (unconnected activity output streams) of the perform document. Each result 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 result data embedded within child CDATA sections. The structure and format of this result data depends on the activity implementations. For example, the sqlQueryStatement activity generates result data in the XML WebRowSet format.A response document corresponding to an asynchronous request will contain only the response and request elements.
The following Perform document sends an SQL query to a relational database and retrieves the results synchronously:
<?xml version="1.0" encoding="UTF-8"?>
<perform
xmlns="http://ogsadai.org.uk/namespaces/2005/03/types">
<documentation>
Perform a simple SELECT statement.
</documentation>
<sqlQueryStatement name="myQuery">
<expression>
select * from littleblackbook where id=10
</expression>
<webRowSetStream name="myQueryOutput"/>
</sqlQueryStatement>
</perform>
This is a corresponding response document:
<?xml version="1.0" encoding="UTF-8"?>
<response xmlns="http://ogsadai.org.uk/namespaces/2005/03/types">
<request xmlns:NS1="http://ogsadai.org.uk/namespaces/2005/03/types"
NS1:status="COMPLETED"/>
<result xmlns:NS1="http://ogsadai.org.uk/namespaces/2005/03/types"
NS1:name="myQuery" NS1:status="COMPLETED"/>
<result xmlns:NS1="http://ogsadai.org.uk/namespaces/2005/03/types"
NS1:name="myQueryOutput" NS1:status="COMPLETED">
<![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<webRowSet schemaLocation="http://java.sun.com/xml/ns/jdbc
http://java.sun.com/xml/ns/jdbc/webrowset.xsd">
...
<currentRow>
<columnValue>10</columnValue>
<columnValue>John Smith</columnValue>
<columnValue>123 Some Lane, AnyTown</columnValue>
<columnValue>0131-555-1234</columnValue>
</currentRow>
...
</result>
</response>
A Response document consists of a root element {http://ogsadai.org.uk/namespaces/2005/03/types}response. This element can contain:
OGSA-DAI/schema/ogsadai/types/general_types.xsd
| Back: Perform Documents | Up: Interacting with Data Resources | Next: Supported Data Resources | |
| © International Business Machines Corporation, 2004. | © The University of Edinburgh, 2004. |