CSW Transaction Insert
A transaction Insert shall contain the full metadata record (in ISO 19139 form) to be inserted.
Sample request:
<csw:Transaction service="CSW" version="2.0.2" xmlns:csw="http://www.opengis.net/cat/csw" > <csw:Insert> <gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd" {... a lot more ns declarations...} > <gmd:fileIdentifier> <gco:CharacterString>1dde15b5-f497-416e-8e5e-744542658bd7</gco:CharacterString> </gmd:fileIdentifier> <gmd:language><gco:CharacterString>eng</gco:CharacterString></gmd:language> <gmd:characterSet> <gmd:MD_CharacterSetCode codeListValue="utf8" codeList="http://www.isotc211.org/2005/resources/codeList.xml#MD_CharacterSetCode"/> </gmd:characterSet> <gmd:contact> .... a lot more elements .... </gmd:MD_Metadata> </csw:Insert> </csw:Transaction>
Sample response:
<?xml version="1.0" ?><csw:TransactionResponse xmlns:csw="http://www.opengis.net/cat/csw/2.0.2"> <csw:TransactionSummary> <csw:totalInserted>1</csw:totalInserted> <csw:totalUpdated>0</csw:totalUpdated> <csw:totalDeleted>0</csw:totalDeleted> </csw:TransactionSummary> <csw:InsertResult handleRef="handleRefValue"> <csw:BriefRecord> <identifier>abcdef123</identifier> </csw:BriefRecord> </csw:InsertResult> </csw:TransactionResponse>
Exception reports:
The following is a sample exception report occurred when trying to insert the same record twice:
<?xml version="1.0" ?> <ows:ExceptionReport version="1.0.0" xmlns:ows="http://www.opengis.net/ows" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd"> <ows:Exception exceptionCode="NoApplicableCode"> <ows:ExceptionText>Cannot process transaction: Immediate unique constraint violation (_ANONYMOUS_CONSTRAINT_17) Columns = ( uuid ) Table = ( APP.Metadata ) </ows:ExceptionText> </ows:Exception> </ows:ExceptionReport>
See the sample file transaction_insert.xml attached to the GN_Transactions_in_python page.
