Skip to content

Catalog Selection

tdipisa edited this page Oct 11, 2012 · 1 revision

Catalog Selector

The "choose Catalog" combobox allows user to select a catalog from a list, setted at configuration time. When the user select a catalog, the application make an AJAX GetCapabilities Request to the remote CSW, than parses the response. THE HTTP GET URL is shown below.

Understand the ows:exception is hard! Sometimes the Catalog Service cannot perform a getCapabilities but you can perform a getRecords, anyway! Sometimes the csw do not response with standard xml, but expose an HTML page.

Capability Test

So we can distinguish different cases:

Success

In this case the HTTP response body contains the tag <Capabilities> and it exposes all service capabilities about the CSW Service Exemple Response:

<?xml version="1.0" encoding="UTF-8"?>
<csw:Capabilities xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" 
				  xmlns:gml="http://www.opengis.net/gml" 
				  xmlns:gmd="http://www.isotc211.org/2005/gmd" 
				  xmlns:ows="http://www.opengis.net/ows" 
				  xmlns:ogc="http://www.opengis.net/ogc" 
				  xmlns:xlink="http://www.w3.org/1999/xlink" 
				  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
				  version="2.0.2" 
				  xsi:schemaLocation="http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd">
  <ows:ServiceIdentification>
	<ows:Title />
	<ows:Abstract />
	<ows:Keywords>
		 [...]
	</ows:Keywords>
	<ows:ServiceType>CSW</ows:ServiceType>
	<ows:ServiceTypeVersion>2.0.2</ows:ServiceTypeVersion>
	<ows:Fees />
	<ows:AccessConstraints />
  </ows:ServiceIdentification>
 
  [...]

</csw:Capabilities>

Exception

Unable to perform GetCapabilities

In this case exceptionCode="NoApplicableCode". The search is allowed but the application display an alert to notify the problem.

Exemple Response:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows" version="1.0.0">
  <ows:Exception exceptionCode="VersionNegotiationFailed">
	<ows:ExceptionText>2.0.2</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

CSW Service not Avaible

In this case the exception raised is about the service field so the exception tag has locator="service" as attribute. Search is denied and an alert notify the problem.

Exemple Response:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows" 
					 version="1.0.0">
	 <ows:Exception exceptionCode="InvalidParameterValue" 
					locator="service">
		 <ows:ExceptionText>
			  CSW
		 </ows:ExceptionText>
   </ows:Exception>
</ows:ExceptionReport>

Version Unsupported

This is the simpler error to understand. The Exception tag contains exceptionCode="VersionNegotiationFailed" as attibute. Search is denied and an alert notify the problem.

Exemple response:

<?xml version="1.0" encoding="UTF-8"?>
<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows" version="1.0.0">
  <ows:Exception exceptionCode="VersionNegotiationFailed">
	<ows:ExceptionText>2.0.2</ows:ExceptionText>
  </ows:Exception>
</ows:ExceptionReport>

Not parsable response

In this case, the search is not allowed. The service url should not be a CSW server too.

Clone this wiki locally