DAP4 Error Response

From OPeNDAP Documentation
Revision as of 21:04, 19 November 2013 by Ndp (talk | contribs) (Created page with "=== DAP4 Error Response === The DAP4 protocol returns error information using an Error response. If a request for any of the three basic responses cannot be completed then ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
⧼opendap2-jumptonavigation⧽

DAP4 Error Response

The DAP4 protocol returns error information using an Error response. If a request for any of the three basic responses cannot be completed then an Error response is returned in its place.

The normative XML representation for the Error Response is defined by the following RELAX-NG schema.

<grammar xmlns="http://relaxng.org/ns/structure/1.0"
                xmlns:doc="http://www.example.com/annotation"
                datatypeLibrary="http://xml.opendap.org/datatypes/dap4"
                ns="http://xml.opendap.org/ns/DAP/4.0#"
                >
<start>
  <ref name="errorresponse"/>
</start>
<define name="errorresponse">
  <element name="Error">
    <optional>
      <attribute name="httpcode"><data type="dap4_integer"/></attribute>
    </optional>
    <optional>
      <interleave>
        <element name = "Message"><text/></Message>
        <element name = "Context"><text/></Message>
        <element name = "OtherInformation"><text/></Message>
      </interleave>
    </optional>
  </element>
</define>

The Error element has one optional attribute: the httpcode which is a standard HTTP protocol return code indicating the general class of error. When possible, this code should match the return code in the HTTP headers for the response.

The body of the <Error> element may contain any or all of the following inner elements each containing arbitrary text.

  1. <Message> — A short informative message describing the error.
  2. <Context> — Information describing the context in which the error occurred: position of a parse error in a constraint expression, for example.
  3. <OtherInformation> — Arbitrary additional text information: a Java stack trace, for example.

Error Response Resource Role

DAP4 Error Responses are identified by the resource role:

http://services.opendap.org/dap4/error

Normative Encoding of the Error Response

The normative XML representation for the Error Response is defined in Appendix x "Normative XML Encoding of the Error Response". The media type for the normative XML representation is:

application/vnd.opendap.dap4.error.xml