Exception Handling
Exception Handling
Exceptions are XML responses to any of the WFS Simple requests.
This text is mostly copied from the OGC Common Specification (http://www.opengeospatial.org/standards/common).
Exception report contents
|
Name |
Definition |
Data type and value |
Multiplicity and use |
|
ExceptionText |
Text describing the specific exception represented by the exceptionCode |
Character String type, not empty Value is exception description as defined by individual servers |
Zero or more (optional) (a) Omitted only when no more useful information available |
|
exceptionCode |
Code representing the type of this exception |
Character String type, not empty Allowed values are specified by each Implementation Specification and server implementation |
One (mandatory) |
|
locator |
Indicator of the location in the client's operation request where this exception was encountered. Usually the name of the parameter that caused problems. |
Character String type, not empty Contents defined for each allowed exceptionCode value for each operation b |
Zero or one (optional) Omitted when no useful value available |
| a When included, multiple ExceptionText values shall provide hierarchical information about one detected error, with the most significant information listed first. | |||
In addition to the Exception elements, an Exception Report shall also contain the parameters specified in the table below.
|
Name |
Definition |
Data type and value |
Multiplicity and use |
|
Version |
Specification version, in this case the version to which this Exception Report conforms |
Character String type, not empty Value format is x.y.z, where x, y, and z are non-negative integers separated by decimal points (e.g., “2.1.3”) Value is specified by each Implementation Specification and Schemas version |
One (mandatory) |
exceptionCode attribute values
|
exceptionCode value |
Meaning of code |
“locator” value |
|
OperationNotSupported |
Request is for an operation that is not supported by this server |
Name of operation not supported |
|
MissingParameterValue |
Operation request does not include a parameter value, and this server did not declare a default value for that parameter |
Name of missing parameter |
|
InvalidParameterValue |
Operation request contains an invalid parameter value a |
Name of parameter with invalid value |
|
ResourceNotFound |
This is a configuration error. This could be a plugin not found in a java environment where the classloader misses the class in the CLASSPATH or a required interface in a class is not implemented. |
A short description what went wrong (i.e. the name of the faulty or required class). |
|
NoApplicableCode |
No other exceptionCode specified by this service and server applies to this exception |
None, omit “locator” parameter |
|
a When an invalid parameter value is received, it seems desirable to place the invalid value(s) in ExceptionText string(s) associated with the InvalidParameterValue value. |
||
Examples
missing parameter
request
http://example.com/wfssimple?OUTPUTFORMAT=text/xml
response
<?xml version="1.0" encoding="UTF-8"?>
<ExceptionReport version="1.0">
<Exception exceptionCode="MissingParameterValue" locator="request"/>
</ExceptionReport>
invalid parameter
request
http://example.com/wfssimple?request=GetFeature&BBBBox=0,0,2,2
response
<?xml version="1.0" encoding="UTF-8"?>
<ExceptionReport version="1.0">
<Exception exceptionCode="InvalidParameterValue" locator="BBBBox">
<ExceptionText>BBBBox is not a known parameter<ExceptionText>
</Exception>
</ExceptionReport>
server error
request
http://example.com/wfssimple?REQUEST=GetFeature&OUTPUTFORMAT=text/xml
response
<?xml version="1.0" encoding="UTF-8"?>
<ExceptionReport version="1.0">
<Exception exceptionCode="ResourceNotFound">
<ExceptionText>Internal Server error. Java exception:
java.lang.NullPointerException
at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:1094)
at com.wolf.tra.xglanls.XGLanls.analyse(XGLanls.java:32)
<ExceptionText>
</Exception>
</ExceptionReport>

