.. _csw_services: CSW service =========== Introduction ------------ GeoNetwork opensource catalog publishes metadata using CSW (Catalog Services for the Web) protocol supporting HTTP binding to invoke the operations. The protocol operations are described in the document **OpenGISĀ® Catalogue Services Specification**: **http://portal.opengeospatial.org/files/?artifact_id=20555** GeoNetwork it's compliant with 2.0.2 version of specification supporting the next CSW operations: - :ref:`GetCapabilities` - :ref:`DescribeRecord` - :ref:`GetRecordById` - :ref:`GetRecords` - :ref:`Transaction` In this chapter a brief description of the different operations supported in GeoNetwork and some usage examples. To get a complete reference of the operations and parameters of each CSW operation refer to the document **OpenGISĀ® Catalogue Services Specification**. The invocation of the operations from a Java client is analogous as described in before chapter for XML services. CSW operations -------------- The GeoNetwork opensource catalog CSW service operations are accesible thought the url: **http://localhost:8080/geonetwork/srv/en/csw** The CSW operations can be accesed using POST, GET methods and SOAP encoding. .. _GetCapabilities: GetCapabilities ``````````````` **GetCapabilities** operation allows CSW clients to retrieve service metadata from a server. The response to a **GetCapabilities** request is an XML document containing service metadata about the server. Request examples ^^^^^^^^^^^^^^^^ GET request:: http://localhost:8080/geonetwork/srv/en/csw?request=GetCapabilities&service=CSW&acceptVersions=2.0.2&acceptFormats=application%2Fxml POST request:: Url: http://localhost:8080/geonetwork/srv/en/csw Mime-type: application/xml Post data: 2.0.2 application/xml SOAP request:: Url: http://localhost:8080/geonetwork/srv/en/csw Mime-type: application/soap+xml Post data: 2.0.2 application/xml .. _DescribeRecord: DescribeRecord `````````````` **DescribeRecord** operation allows a client to discover elements of the information model supported by the target catalogue service. The operation allows some or all of the information model to be described. Request examples ^^^^^^^^^^^^^^^^ GET request:: http://localhost:8080/geonetwork/srv/en/csw?request=DescribeRecord&service=CSW&version=2.0.2&outputFormat=application%2Fxml&schemaLanguage=http%3A%2F%2Fwww.w3.org%2FXML%2FSchema&namespace=csw%3Ahttp%3A%2F%2Fwww.opengis.net%2Fcat%2Fcsw%2F2.0.2 POST request:: Url: http://localhost:8080/geonetwork/srv/en/csw Mime-type: application/xml Post data: SOAP request:: Url: http://localhost:8080/geonetwork/srv/en/csw Mime-type: application/soap+xml Post data: .. _GetRecordById: GetRecordById ````````````` **GetRecordById** request retrieves the default representation of catalogue metadata records using their identifier. To retrieve non public metadata a previous**xml.user.login** service invocation is required. See :ref:`login service `. Request examples ^^^^^^^^^^^^^^^^ GET request:: http://localhost:8080/geonetwork/srv/en/csw?request=GetRecordById&service=CSW&version=2.0.2&elementSetName=full&id=5df54bf0-3a7d-44bf-9abf-84d772da8df1 POST request:: Url: http://localhost:8080/geonetwork/srv/en/csw Mime-type: application/xml Post data: 5df54bf0-3a7d-44bf-9abf-84d772da8df1 full SOAP request:: Url: http://localhost:8080/geonetwork/srv/en/csw Mime-type: application/soap+xml Post data: 5df54bf0-3a7d-44bf-9abf-84d772da8df1 full .. _GetRecords: GetRecords `````````` GetRecords request allows to query the catalogue metadata records specifying a query in OCG Filter or CQL languages. To retrieve non public metadata a previous**xml.user.login** service invocation is required. See :ref:`login service `. Request examples ^^^^^^^^^^^^^^^^ GET request (using CQL language):: Url: http://localhost:8080/geonetwork/srv/en/csw?request=GetRecords&service=CSW&version=2.0.2&namespace=xmlns%28csw%3Dhttp%3A%2F%2Fwww.opengis.net%2Fcat%2Fcsw%2F2.0.2%29%2Cxmlns%28gmd%3Dhttp%3A%2F%2Fwww.isotc211.org%2F2005%2Fgmd%29&constraint=AnyText+like+%25africa%25&constraintLanguage=CQL_TEXT&constraint_language_version=1.1.0&typeNames=csw%3ARecord POST request:: Url: http://localhost:8080/geonetwork/srv/en/csw Mime-type: application/xml Post data: AnyText %africa% SOAP request:: Url: http://localhost:8080/geonetwork/srv/en/csw Mime-type: application/soap+xml Post data: AnyText %africa% .. _Transaction: Transaction ``````````` The **Transaction** operation defines an interface for creating, modifying and deleting catalogue records. This operation requires user authentification to be invoqued. Insert operation example ^^^^^^^^^^^^^^^^^^^^^^^^ POST request:: Url: http://localhost:8080/geonetwork/srv/en/csw Mime-type: application/xml Post data: ... Response:: Url: 1 0 0 Update operation example ^^^^^^^^^^^^^^^^^^^^^^^^ POST request:: Url: http://localhost:8080/geonetwork/srv/en/csw Mime-type: application/xml Post data: ... title Eurasia Response:: 0 1 0 Delete operation example ^^^^^^^^^^^^^^^^^^^^^^^^ POST request:: Url: http://localhost:8080/geonetwork/srv/en/csw Mime-type: application/xml Post data: title africa Response:: 0 0 1 Errors ^^^^^^ - User is not authenticated:: Cannot process transaction: User not authenticated.