INSPIRE Geoportal Metadata Validator Web Service

It is a RESTful Web service that can be invoked via HTTP to validate metadata and Network Services under the scope of INSPIRE.

Examples of how to interact with the service in various programming languages, are presented in the section "Client code examples".

The outcome of the validation is a document (see "What the service returns"), unless a critical error condition occurs (see "Endpoint and bindings").

The documents produced by the validator are created in XML format, from which the JSON and HTML formats are derived.
Which format is returned to the client is determined through content negotiation, i.e. it is based on the "Accept" header present in the HTTP request.
The XML documents follow a structure which is formally specified (see "XML Schemas") .

The Content type header set by the client in the request affects the following aspects (see "Endpoint and bindings"):
  • The response of the web service, in terms of the HTTP status code, response body and Location header
  • Whether the request execution is synchronous or it is switched to asynchronous after a timeout and the client must then poll the given location until the retrieved document is complete.

The response document is always a Geoportal Resource, unless a critical error condition is encountered (See Common HTTP Response codes at "Endpoint and bindings" )
A Geoportal Resource is an envelope containing a payload (See "The payloads") plus some additional information required by the Geoportal
A payload can be a report of the validation issues, or a representation of the metadata of the spatial resource like a Spatial Data Set or a Network Service.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:Resource xmlns="http://inspire.ec.europa.eu/schemas/common/1.0"  xmlns:ns2="http://inspire.ec.europa.eu/schemas/geoportal/1.0">
... the actual payload appears here
	<ns2:AuditRecord>
		<ns2:CreationDate>2015-11-10T16:51:19.475Z</ns2:CreationDate>
		<ns2:LastUpdateDate>2015-11-10T16:51:29.603Z</ns2:LastUpdateDate>
	</ns2:AuditRecord>
	<ns2:GeoportalMetadataLocator>
		<URL>/sandbox/INSPIRE-42f32550-87cb-11e5-a300-a0369f4c5bc0_20151110-175117</URL>
		<MediaType>application/vnd.eu.europa.ec.inspire.resource+xml</MediaType>
		<FileName>inspire.geoportal.resource.xml</FileName>
	</ns2:GeoportalMetadataLocator>
	<ns2:RelatedResourceLocator>
		<URL>services/1</URL>
		<MediaType>application/vnd.eu.europa.ec.inspire.geoportal.resource.service+xml</MediaType>
		<LinkDescription metadataLanguage="cze">WMS INSPIRE Bioregiony (Agentura ochrany přírody a krajiny České republiky)</LinkDescription>
	</ns2:RelatedResourceLocator>
	<ns2:CompletenessIndicator>100.0</ns2:CompletenessIndicator>
	<ns2:ValidationEngineVersion>hudson-INSPIREWebServices-1210</ns2:ValidationEngineVersion>
</ns2:Resource>
                                
If more than one resource is detected (for example in a GetRecordsResponse document containing multiple metadata documents) the validation result is a summary report containing statistics about the number of resources found and the links to the validation reports of the individual resources.

A summary report is returned when multiple resources are detected or when the request is switched to asynchronous execution

A PullBatchReportResource element identifies a summary report in the XML format. The validation outcome of each resource can be obtained navigating the provided links.
There is one ChildResourceLocator elementfor each resource that has at least a warning or an error.
There is one RelatedResourceLocator element for each resource that has been validated.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:Resource xmlns="http://inspire.ec.europa.eu/schemas/common/1.0" xmlns:ns6="http://inspire.ec.europa.eu/schemas/inspire_ds/1.0" xmlns:ns5="http://www.w3.org/1999/xlink" xmlns:ns8="http://www.opengis.net/wms" xmlns:ns7="http://www.opengis.net/ows/1.1" xmlns:ns9="http://www.opengis.net/ogc" xmlns:ns11="http://inspire.ec.europa.eu/schemas/inspire_vs_ows11/1.0" xmlns:ns10="http://inspire.ec.europa.eu/schemas/inspire_vs/1.0" xmlns:ns2="http://inspire.ec.europa.eu/schemas/geoportal/1.0" xmlns:ns4="http://www.opengis.net/ows" xmlns:ns3="http://inspire.ec.europa.eu/schemas/inspire_dls/1.0">
    <ns2:PullBatchReportResource>
        <ns2:FoundResourcesCount>5</ns2:FoundResourcesCount>
        <ns2:SourceValidationFailedCount>0</ns2:SourceValidationFailedCount>
        <ns2:InspireValidationFailedCount>2</ns2:InspireValidationFailedCount>
        <ns2:InspireValidationWarningCount>2</ns2:InspireValidationWarningCount>
...
    <ns2:ChildResourceLocator completenessIndicator="94.44444444444444">
        <URL>datasets/5/resourceReport</URL>
        <MediaType>application/vnd.eu.europa.ec.inspire.resource+xml</MediaType>
        <LinkDescription metadataLanguage="dut">Transport Netwerken (Kadaster)</LinkDescription>
    </ns2:ChildResourceLocator>
...
    <ns2:RelatedResourceLocator>
        <URL>datasets/5</URL>
        <MediaType>application/vnd.eu.europa.ec.inspire.geoportal.resource.dataset+xml</MediaType>
        <LinkDescription metadataLanguage="dut">Transport Netwerken (Kadaster)</LinkDescription>
    </ns2:RelatedResourceLocator>
    <ns2:OriginalRepresentation>http://nationaalgeoregister.nl/geonetwork/srv/dut/inspire?request=GetRecords&service=CSW&version=2.0.2&resultType=results&namespace=xmlns(csw=http://www.opengis.net/cat/csw/2.0.2),xmlns(gmd=http://www.isotc211.org/2005/gmd)&outputFormat=application/xml&outputSchema=http://www.isotc211.org/2005/gmd&startPosition=1&maxRecords=5&elementSetName=full&constraintLanguage=FILTER&constraint_language_version=1.1.0&typeNames=gmd:MD_Metadata</ns2:OriginalRepresentation>
    <ns2:CompletenessIndicator>97.77777777777779</ns2:CompletenessIndicator>
    <ns2:ValidationEngineVersion>hudson-INSPIREWebServices-1210</ns2:ValidationEngineVersion>
</ns2:Resource>
                                            

A single report is returned when only one resource is detected and the resource has at least one error or warning

A ResourceReportResource (row n.3) element identifies a single validation report in the XML format.
It can contain zero or one of the following elements:
  • SourceValidationErrors (row n.4) for errors with respect to the original representation of the resource, e.g. its XML schema
  • InspireValidationErrors (row n.51): for errors with respect to the INSPIRE requirements
  • InspireValidationWarnings (row n.165) for warnings with respect to the INSPIRE requirements
  • TransformationErrors for technical errors related to the transformation process
  • ProcessingErrors for other technical issues
  • SolrErrors present only in reports of resources live in the INSPIRE Geoportal
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:Resource xmlns="http://inspire.ec.europa.eu/schemas/common/1.0" xmlns:ns6="http://inspire.ec.europa.eu/schemas/inspire_ds/1.0" xmlns:ns5="http://www.w3.org/1999/xlink" xmlns:ns8="http://www.opengis.net/wms" xmlns:ns7="http://www.opengis.net/ows/1.1" xmlns:ns9="http://www.opengis.net/ogc" xmlns:ns11="http://inspire.ec.europa.eu/schemas/inspire_vs_ows11/1.0" xmlns:ns10="http://inspire.ec.europa.eu/schemas/inspire_vs/1.0" xmlns:ns2="http://inspire.ec.europa.eu/schemas/geoportal/1.0" xmlns:ns4="http://www.opengis.net/ows" xmlns:ns3="http://inspire.ec.europa.eu/schemas/inspire_dls/1.0">
    <ns2:ResourceReportResource>
        <ns2:SourceValidationErrors>
            <ns2:ValidationSchema>
                <ns2:Specification xsi:type="citationISO19139SRV2006_eng" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                    <Title>19139 XSchemas TS RC (2006 May 4)</Title>
                    <DateOfPublication>2006-05-04</DateOfPublication>
                    <ResourceLocator xsi:type="resLocISO19139SRV2006_eng">
                        <URL>http://schemas.opengis.net/iso/19139/20060504/srv/srv.xsd</URL>
                        <MediaType>application/xml</MediaType>
                    </ResourceLocator>
                </ns2:Specification>
            </ns2:ValidationSchema>
            <ns2:SourceOfRequirement>
                <ns2:Specification xsi:type="citationMDTG1.2_eng" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                    <Title>INSPIRE Metadata Implementing Rules: Technical Guidelines based on EN ISO 19115 and EN ISO 19119 (Version 1.2)</Title>
                    <DateOfPublication>2010-06-16</DateOfPublication>
                    <URI>MD_IR_and_ISO_v1_2_20100616</URI>
                    <ResourceLocator xsi:type="resLocTGMD1.2_eng">
                        <URL>http://inspire.jrc.ec.europa.eu/documents/Metadata/INSPIRE_MD_IR_and_ISO_v1_2_20100616.pdf</URL>
                        <MediaType>application/pdf</MediaType>
                    </ResourceLocator>
                </ns2:Specification>
            </ns2:SourceOfRequirement>
            <ns2:SourceValidationError>
                <ns2:SourceMetadataLocator>
                    <URL>../../../5.iso19139.xml</URL>
                    <MediaType>application/vnd.iso.19139+xml</MediaType>
                </ns2:SourceMetadataLocator>
                <ns2:GeoportalExceptionMessage>
                    <ns2:Message>In content of element <MD_Format>: The content is incomplete. Expected <Q{.../gmd}version>.  at column 35, line 587</ns2:Message>
                    <ns2:ExceptionCode>error.geoportal.discovery.metadata.xmlvalidation</ns2:ExceptionCode>
                    <ns2:GeoportalErrorCode>error.geoportal.discovery.metadata.xmlvalidation</ns2:GeoportalErrorCode>
                    <ns2:Argument>
                        <ns2:ArgumentName>Error Message</ns2:ArgumentName>
                        <ns2:ArgumentValue>In content of element <MD_Format>: The content is incomplete. Expected <Q{.../gmd}version>. </ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:Argument>
                        <ns2:ArgumentName>Column Number</ns2:ArgumentName>
                        <ns2:ArgumentValue>35</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:Argument>
                        <ns2:ArgumentName>Line Number</ns2:ArgumentName>
                        <ns2:ArgumentValue>587</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:EA_GUID>D927CFAB-AC5B-471b-91C0-36C42597C731</ns2:EA_GUID>
                </ns2:GeoportalExceptionMessage>
            </ns2:SourceValidationError>
        </ns2:SourceValidationErrors>
        <ns2:InspireValidationErrors>
            <ns2:SourceOfRequirement>
                <ns2:Specification xsi:type="citationMDTG1.2_eng" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                    <Title>INSPIRE Metadata Implementing Rules: Technical Guidelines based on EN ISO 19115 and EN ISO 19119 (Version 1.2)</Title>
                    <DateOfPublication>2010-06-16</DateOfPublication>
                    <URI>MD_IR_and_ISO_v1_2_20100616</URI>
                    <ResourceLocator xsi:type="resLocTGMD1.2_eng">
                        <URL>http://inspire.jrc.ec.europa.eu/documents/Metadata/INSPIRE_MD_IR_and_ISO_v1_2_20100616.pdf</URL>
                        <MediaType>application/pdf</MediaType>
                    </ResourceLocator>
                </ns2:Specification>
            </ns2:SourceOfRequirement>
            <ns2:ValidationError>
                <ns2:GeoportalExceptionMessage>
                    <ns2:Message>The Coupled Resource (operatesOn)URL "PTINAG_ART13_ZP_PRAI_PTCONT" is invalid because Malformed URL</ns2:Message>
                    <ns2:ExceptionCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:ExceptionCode>
                    <ns2:GeoportalErrorCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:GeoportalErrorCode>
                    <ns2:Argument>
                        <ns2:ArgumentName>Service Metadata URL</ns2:ArgumentName>
                        <ns2:ArgumentValue>PTINAG_ART13_ZP_PRAI_PTCONT</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:Argument>
                        <ns2:ArgumentName>Reason</ns2:ArgumentName>
                        <ns2:ArgumentValue>Malformed URL</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:EA_GUID>926128BB-ADEF-47ec-9F66-604488FB8A6A</ns2:EA_GUID>
                </ns2:GeoportalExceptionMessage>
                <ns2:GeoportalExceptionMessage>
                    <ns2:Message>The Coupled Resource (operatesOn)URL "PTINAG_ART13_ZP_HABI_PTCONT" is invalid because Malformed URL</ns2:Message>
                    <ns2:ExceptionCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:ExceptionCode>
                    <ns2:GeoportalErrorCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:GeoportalErrorCode>
                    <ns2:Argument>
                        <ns2:ArgumentName>Service Metadata URL</ns2:ArgumentName>
                        <ns2:ArgumentValue>PTINAG_ART13_ZP_HABI_PTCONT</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:Argument>
                        <ns2:ArgumentName>Reason</ns2:ArgumentName>
                        <ns2:ArgumentValue>Malformed URL</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:EA_GUID>926128BB-ADEF-47ec-9F66-604488FB8A6A</ns2:EA_GUID>
                </ns2:GeoportalExceptionMessage>
                <ns2:GeoportalExceptionMessage>
                    <ns2:Message>The Coupled Resource (operatesOn)URL "PTINAG_ART13_ZP_ZVUL_PTCONT" is invalid because Malformed URL</ns2:Message>
                    <ns2:ExceptionCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:ExceptionCode>
                    <ns2:GeoportalErrorCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:GeoportalErrorCode>
                    <ns2:Argument>
                        <ns2:ArgumentName>Service Metadata URL</ns2:ArgumentName>
                        <ns2:ArgumentValue>PTINAG_ART13_ZP_ZVUL_PTCONT</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:Argument>
                        <ns2:ArgumentName>Reason</ns2:ArgumentName>
                        <ns2:ArgumentValue>Malformed URL</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:EA_GUID>926128BB-ADEF-47ec-9F66-604488FB8A6A</ns2:EA_GUID>
                </ns2:GeoportalExceptionMessage>
                <ns2:GeoportalExceptionMessage>
                    <ns2:Message>The Coupled Resource (operatesOn)URL "PTINAG_ART13_ZP_PISC_PTCONT" is invalid because Malformed URL</ns2:Message>
                    <ns2:ExceptionCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:ExceptionCode>
                    <ns2:GeoportalErrorCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:GeoportalErrorCode>
                    <ns2:Argument>
                        <ns2:ArgumentName>Service Metadata URL</ns2:ArgumentName>
                        <ns2:ArgumentValue>PTINAG_ART13_ZP_PISC_PTCONT</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:Argument>
                        <ns2:ArgumentName>Reason</ns2:ArgumentName>
                        <ns2:ArgumentValue>Malformed URL</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:EA_GUID>926128BB-ADEF-47ec-9F66-604488FB8A6A</ns2:EA_GUID>
                </ns2:GeoportalExceptionMessage>
                <ns2:GeoportalExceptionMessage>
                    <ns2:Message>The Coupled Resource (operatesOn)URL "PTINAG_ART13_ZP_CAPT_PTCONT" is invalid because Malformed URL</ns2:Message>
                    <ns2:ExceptionCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:ExceptionCode>
                    <ns2:GeoportalErrorCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:GeoportalErrorCode>
                    <ns2:Argument>
                        <ns2:ArgumentName>Service Metadata URL</ns2:ArgumentName>
                        <ns2:ArgumentValue>PTINAG_ART13_ZP_CAPT_PTCONT</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:Argument>
                        <ns2:ArgumentName>Reason</ns2:ArgumentName>
                        <ns2:ArgumentValue>Malformed URL</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:EA_GUID>926128BB-ADEF-47ec-9F66-604488FB8A6A</ns2:EA_GUID>
                </ns2:GeoportalExceptionMessage>
                <ns2:GeoportalExceptionMessage>
                    <ns2:Message>The Coupled Resource (operatesOn)URL "PTINAG_ART13_ZP_ZSEN_PTCONT" is invalid because Malformed URL</ns2:Message>
                    <ns2:ExceptionCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:ExceptionCode>
                    <ns2:GeoportalErrorCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:GeoportalErrorCode>
                    <ns2:Argument>
                        <ns2:ArgumentName>Service Metadata URL</ns2:ArgumentName>
                        <ns2:ArgumentValue>PTINAG_ART13_ZP_ZSEN_PTCONT</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:Argument>
                        <ns2:ArgumentName>Reason</ns2:ArgumentName>
                        <ns2:ArgumentValue>Malformed URL</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:EA_GUID>926128BB-ADEF-47ec-9F66-604488FB8A6A</ns2:EA_GUID>
                </ns2:GeoportalExceptionMessage>
                <ns2:GeoportalExceptionMessage>
                    <ns2:Message>The Coupled Resource (operatesOn)URL "PTINAG_ART13_ZP_AVES_PTCONT" is invalid because Malformed URL</ns2:Message>
                    <ns2:ExceptionCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:ExceptionCode>
                    <ns2:GeoportalErrorCode>error.geoportal.metadata.service.coupledresource.invalid</ns2:GeoportalErrorCode>
                    <ns2:Argument>
                        <ns2:ArgumentName>Service Metadata URL</ns2:ArgumentName>
                        <ns2:ArgumentValue>PTINAG_ART13_ZP_AVES_PTCONT</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:Argument>
                        <ns2:ArgumentName>Reason</ns2:ArgumentName>
                        <ns2:ArgumentValue>Malformed URL</ns2:ArgumentValue>
                    </ns2:Argument>
                    <ns2:EA_GUID>926128BB-ADEF-47ec-9F66-604488FB8A6A</ns2:EA_GUID>
                </ns2:GeoportalExceptionMessage>
            </ns2:ValidationError>
...
        </ns2:InspireValidationErrors>
        <ns2:InspireValidationWarnings>
            <ns2:ValidationError>
                <ns2:SourceOfRequirement>
                    <ns2:Specification xsi:type="citationMDTG1.2_eng" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                        <Title>INSPIRE Metadata Implementing Rules: Technical Guidelines based on EN ISO 19115 and EN ISO 19119 (Version 1.2)</Title>
                        <DateOfPublication>2010-06-16</DateOfPublication>
                        <URI>MD_IR_and_ISO_v1_2_20100616</URI>
                        <ResourceLocator xsi:type="resLocTGMD1.2_eng">
                            <URL>http://inspire.jrc.ec.europa.eu/documents/Metadata/INSPIRE_MD_IR_and_ISO_v1_2_20100616.pdf</URL>
                            <MediaType>application/pdf</MediaType>
                        </ResourceLocator>
                    </ns2:Specification>
                </ns2:SourceOfRequirement>
                <ns2:GeoportalExceptionMessage>
                    <ns2:Message>No valid resource locator has been found</ns2:Message>
                    <ns2:ExceptionCode>error.geoportal.service.locator.novalidfound</ns2:ExceptionCode>
                    <ns2:GeoportalErrorCode>error.geoportal.service.locator.novalidfound</ns2:GeoportalErrorCode>
                    <ns2:EA_GUID>37C3837A-D130-41ce-863B-7E3E474503B6</ns2:EA_GUID>
                </ns2:GeoportalExceptionMessage>
            </ns2:ValidationError>
        </ns2:InspireValidationWarnings>
    </ns2:ResourceReportResource>
    <ns2:AuditRecord>
        <ns2:CreationDate>2015-11-05T03:28:56.061Z</ns2:CreationDate>
        <ns2:LastUpdateDate>2015-11-05T03:29:15.068Z</ns2:LastUpdateDate>
    </ns2:AuditRecord>
    <ns2:SourceMetadataLocator>
        <URL>../../../5.iso19139.xml</URL>
        <MediaType>application/vnd.iso.19139+xml</MediaType>
    </ns2:SourceMetadataLocator>
    <ns2:GeoportalMetadataLocator>
        <URL>/INSPIRE-d60bf7f3-ea96-11e4-a2c7-52540004b857_20151105-042100/services/1/PullResults/1101-1120/services/5/resourceReport</URL>
        <MediaType>application/vnd.eu.europa.ec.inspire.resource+xml</MediaType>
        <FileName>inspire.geoportal.resource.xml</FileName>
    </ns2:GeoportalMetadataLocator>
    <ns2:ParentResourceMetadataLocator>
        <URL>../../..</URL>
        <MediaType>application/vnd.eu.europa.ec.inspire.resource+xml</MediaType>
    </ns2:ParentResourceMetadataLocator>
    <ns2:SiblingPrevResourceMetadataLocator>
        <URL>../../4/resourceReport</URL>
        <MediaType>application/vnd.eu.europa.ec.inspire.resource+xml</MediaType>
    </ns2:SiblingPrevResourceMetadataLocator>
    <ns2:SiblingNextResourceMetadataLocator>
        <URL>../../6/resourceReport</URL>
        <MediaType>application/vnd.eu.europa.ec.inspire.resource+xml</MediaType>
    </ns2:SiblingNextResourceMetadataLocator>
    <ns2:RelatedResourceLocator>
        <URL>..</URL>
        <MediaType>application/vnd.eu.europa.ec.inspire.geoportal.resource.service+xml</MediaType>
        <LinkDescription metadataLanguage="por">Zonas Protegidas da Lei da Água (Instituto da Água, I. P.)</LinkDescription>
    </ns2:RelatedResourceLocator>
    <ns2:MemberStateCountryCode>PT</ns2:MemberStateCountryCode>
    <ns2:MemberStateDiscoveryServiceResourceLocator>
        <URL>..</URL>
        <MediaType>application/vnd.eu.europa.ec.inspire.geoportal.resource.service.network.discovery+xml</MediaType>
        <LinkDescription>
      Serviço de Catálogo do Sistema Nacional de Informação Geográfica (Geoportal 1.2.4 - OGC CSW 2.0.2 ISO AP)
    </LinkDescription>
    </ns2:MemberStateDiscoveryServiceResourceLocator>
    <ns2:CompletenessIndicator>71.42857142857143</ns2:CompletenessIndicator>
</ns2:Resource>
                                            

A spatial resource is returned when only one resource is detected, no validation issues are found, and the request remained synchronous

  • SpatialDataSetResource (row n.3)
  • SpatialDataSetSeriesResource
  • SpatialDataService
  • DiscoveryServiceResource
  • ViewServiceResource
  • ViewServiceLayerResource
  • DownloadServiceResource
  • DownloadServiceSpatialDataSetResource
The validation outcome of each resource can be obtained navigating the provided links.
There is one ChildResourceLocator element for each resource that has at least a warning or an error.
There is one RelatedResourceLocator element for each resource that has been validated.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:Resource xmlns="http://inspire.ec.europa.eu/schemas/common/1.0" xmlns:ns6="http://inspire.ec.europa.eu/schemas/inspire_ds/1.0" xmlns:ns5="http://www.w3.org/1999/xlink" xmlns:ns8="http://www.opengis.net/wms" xmlns:ns7="http://www.opengis.net/ows/1.1" xmlns:ns9="http://www.opengis.net/ogc" xmlns:ns11="http://inspire.ec.europa.eu/schemas/inspire_vs_ows11/1.0" xmlns:ns10="http://inspire.ec.europa.eu/schemas/inspire_vs/1.0" xmlns:ns2="http://inspire.ec.europa.eu/schemas/geoportal/1.0" xmlns:ns4="http://www.opengis.net/ows" xmlns:ns3="http://inspire.ec.europa.eu/schemas/inspire_dls/1.0">
    <ns2:SpatialDataSetResource remoteIdentifier="d4ddfe78-f980-46e4-90ec-436c594109a1">
        <ResourceTitle>Ortophoto of Hungary, 2000</ResourceTitle>
        <ResourceAbstract>In the frame of European Harmonisation Programme of the Department of Land Administration and Geoinformation at the Ministry of Agriculture and Rural Development three nationwide connected projects were launched by FÖMI in 2000 to be carried out during 3 years. These are: “Wall to wall aerial photography of Hungary”, Creation of 5 m x 5 m resolution DEM of the country, Set up of full digital orthophoto coverage of Hungary. The project “Aerial photography of Hungary 2000” was finished successfully. Now in the archives of FÖMI about 7000 aerial photos at scale 1:30 000 are available in analogue and digital forms. As a result of almost 20 years project – ended in 1999 – Hungary is covered by ~ 4092 map sheets at the scale 1:10 000 in analogue form. The estimated and overall quality controlled accuracy of contour lines is between ± 0.5-±1.5 m, depending on the interval of contour lines of a given map sheet according to the national standard. In the national archives of FÖMI we have the colour prints, the individual layers of contour lines, planimetry and hydrography of 4098 sheets (altogether 4 x 4098 sheets). During one year period the colour prints and three layers (hydrography, planimetry, contour lines) of 1:10 000 scale topomaps were scanned and geo-referenced. The layers of contour lines of topomaps were vectorised in the period 2000-2003.</ResourceAbstract>
        <ResourceType>dataset</ResourceType>
        <ResourceLocator originalEncodingReference="gmd:transferOptions">
            <URL>http://www.geoshop.hu/</URL>
        </ResourceLocator>
        <MandatoryKeyword>
            <OriginatingControlledVocabulary>
                <Title>GEMET - INSPIRE themes</Title>
                <DateOfPublication>2008-06-01</DateOfPublication>
            </OriginatingControlledVocabulary>
            <KeywordValue>Orthoimagery</KeywordValue>
            <KeywordLocator>
                <URL>#</URL>
                <LinkDescription metadataLanguage="eng">ORTHOIMAGERY</LinkDescription>
            </KeywordLocator>
        </MandatoryKeyword>
        <Keyword>
            <OriginatingControlledVocabulary>
                <Title>GEMET - INSPIRE themes, version 1.0</Title>
                <DateOfPublication>2008-06-01</DateOfPublication>
            </OriginatingControlledVocabulary>
            <KeywordValue>digital, ortophoto</KeywordValue>
        </Keyword>
        <GeographicBoundingBox>
            <East>22.9</East>
            <West>16.11</West>
            <North>48.59</North>
            <South>45.74</South>
        </GeographicBoundingBox>
        <TemporalReference>
            <DateOfCreation>2004-05-17</DateOfCreation>
        </TemporalReference>
        <TemporalReference>
            <DateOfPublication>2004-05-17</DateOfPublication>
        </TemporalReference>
        <TemporalReference>
            <DateOfLastRevision>2004-06-07</DateOfLastRevision>
        </TemporalReference>
        <SpatialResolution>
            <ResolutionDistance>50</ResolutionDistance>
            <UnitOfMeasure>centimeters</UnitOfMeasure>
        </SpatialResolution>
        <Conformity>
            <Specification>
                <Title>Commission Regulation (EU) No 1089/2010 of 23 November 2010 implementing Directive 2007/2/EC of the European Parliament and of the Council as regards interoperability of spatial data sets and services</Title>
                <DateOfPublication>2010-12-08</DateOfPublication>
            </Specification>
            <Degree>notEvaluated</Degree>
        </Conformity>
        <ConditionsForAccessAndUse>it is a commercial product</ConditionsForAccessAndUse>
        <LimitationsOnPublicAccess>(e) intellectual property rights;</LimitationsOnPublicAccess>
        <ResponsibleOrganisation>
            <ResponsibleParty>
                <OrganisationName>Institute of Geodesy, Cartography and Remote Sensing</OrganisationName>
                <EmailAddress>schmauder.tamas@fomi.hu</EmailAddress>
            </ResponsibleParty>
            <ResponsiblePartyRole>author</ResponsiblePartyRole>
        </ResponsibleOrganisation>
        <MetadataPointOfContact>
            <OrganisationName>Institute of Geodesy, Cartography and Remote Sensing</OrganisationName>
            <EmailAddress>schmauder.tamas@fomi.hu</EmailAddress>
        </MetadataPointOfContact>
        <MetadataDate>2014-11-25T16:02:16</MetadataDate>
        <MetadataLanguage>eng</MetadataLanguage>
        <UniqueResourceIdentifier>
            <Code>c68e77fd-ee76-421a-b45f-0c27df879aea</Code>
            <Namespace>http://www.geoshop.hu/</Namespace>
        </UniqueResourceIdentifier>
        <ResourceLanguage>eng</ResourceLanguage>
        <TopicCategory>imageryBaseMapsEarthCover</TopicCategory>
        <Lineage>The vectorised contour lines served as the basis for creation of 5 m raster size and 0.7 m accurate in Z DEM for the whole country. The 5 m x 5 m DEM of Hungary (about 4 billion points) archived now according to map grid of 1:10 000 and is available for the user community. A complete photogrammetric technology was elaborated for analytical and digital aerial triangulation to use the existing high accurate 4th order national triangulation network for determination of orientation element of aerial photos taken in 2000. The technology takes into consideration the creation of orthophotos on the base of DEM and the orientation elements of aerial photos adjusted for the whole country. An overall quality control was applied for the whole procedure and for every map sheets of digital orthophotos. The accuracy of aerial triangulation is characterised with ±0.25 m in X and Y ground co-ordinates. The “MADOP” project was finished in June 2003. The high resolution and quality checked orthophotos were archived (about 2.5 terrabyte) as part of meta data base, according to the 1:10 000 map grid and we started to distribute among end-users of several professions. The average accuracy of the orthophotos is characterised by 0.7 m in X, Y on the ground.</Lineage>
        <CoordinateReferenceSystem>
            <UniqueResourceIdentifier>
                <Code>http://www.opengis.net/def/crs/EPSG/0/4936</Code>
            </UniqueResourceIdentifier>
        </CoordinateReferenceSystem>
    </ns2:SpatialDataSetResource>
    <ns2:AuditRecord>
        <ns2:CreationDate>2015-10-28T20:21:14.040Z</ns2:CreationDate>
        <ns2:LastUpdateDate>2015-10-28T20:21:15.677Z</ns2:LastUpdateDate>
    </ns2:AuditRecord>
    <ns2:SourceMetadataLocator remoteIdentifier="d4ddfe78-f980-46e4-90ec-436c594109a1">
        <URL>../../1.iso19139.xml</URL>
        <MediaType>application/vnd.iso.19139+xml</MediaType>
    </ns2:SourceMetadataLocator>
    <ns2:GeoportalMetadataLocator>
        <URL>/INSPIRE-94c474ba-7968-11e4-8b38-52540004b857_20151028-212108/services/1/PullResults/1-20/datasets/1</URL>
        <MediaType>application/vnd.eu.europa.ec.inspire.geoportal.resource.dataset+xml</MediaType>
        <LinkDescription metadataLanguage="eng">Ortophoto of Hungary, 2000 (Institute of Geodesy, Cartography and Remote Sensing)</LinkDescription>
        <FileName>inspire.geoportal.resource.dataset.xml</FileName>
    </ns2:GeoportalMetadataLocator>
    <ns2:SiblingNextResourceMetadataLocator>
        <URL>../2</URL>
        <MediaType>application/vnd.eu.europa.ec.inspire.geoportal.resource.dataset+xml</MediaType>
        <LinkDescription metadataLanguage="eng">Hungarian Cadastral Map (Institute of Geodesy, Cartography and Remote Sensing)</LinkDescription>
    </ns2:SiblingNextResourceMetadataLocator>
    <ns2:MemberStateCountryCode>HU</ns2:MemberStateCountryCode>
    <ns2:MemberStateDiscoveryServiceResourceLocator>
        <URL>../../../..</URL>
        <MediaType>application/vnd.eu.europa.ec.inspire.geoportal.resource.service.network.discovery+xml</MediaType>
        <LinkDescription>FÖMI catalog service / FÖMI katalógus szolgáltatás</LinkDescription>
    </ns2:MemberStateDiscoveryServiceResourceLocator>
    ...
    <ns2:CompletenessIndicator>100.0</ns2:CompletenessIndicator>
</ns2:Resource>

                                        
Tester Web Service End point http://inspire-geoportal.ec.europa.eu/GeoportalProxyWebServices/resources/INSPIREResourceTester
Common HTTP Response codes Status code 400 (Bad Request): The content received could not be understood

Status code 500 (Internal Server Error): An exception occurred on the server

Content-type

This binding is best suited for machine-to-machine interaction.

@POST
@Consumes(MediaType.TEXT_PLAIN)
@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
                                                    
  • The processing is always synchronous
  • The client is never asked to perform a redirect
  • It responds with HTTP 201 (Created) (see "Common HTTP Response codes" for exceptions)
  • It can return application/xml or application/json but not text/html
  • The Location header of the response header is set to the URI where the validation result is already available
  • The representation of the validation result is also returned with the response
  • At the target URI a validation report is made available in two different formats (XML, JSON)
  • The format returned is determined via content negotiation, based on the request Accept header
HTTP method POST
Content-type text/plain
Response formats application/xml, application/json (as set in the Accept header of the request)
Request parameters the body of the POST request contains the text to be validated
Response content

201 (CREATED)

The request succeeded and the following resources are returned:
  • a validation report, if the Validator finds some errors;
  • a representation of the extracted metadata, if the validator doesn't find any errors.

This binding is best suited for interaction with a browser

@POST
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces({MediaType.TEXT_HTML, MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
                                                    
  • The processing starts as synchronous but becomes asynchronous after a timeout
  • A client is asked to perform a redirect to the final URI if the Accept header is text/html
  • It responds with HTTP 301 (Moved Permanently) or 201 (Created) if the Accept header is text/html (see "Common HTTP Response codes" for exceptions)
  • It can return text/html, application/xml or application/json
  • The Location header of the response is set to the URI where the validation result (possibly not yet complete) is available
  • The representation of the validation result is also returned with the response if the Accept header is NOT text/html
HTTP method: POST
Content-type multipart/form-data
Response formats: XML, HTML, JSON (as set in the Accept header of the request)
Request parameters:
  • resourceRepresentation: A textual representation of the resource to be tested
  • uploadedFile: A file containing the resource. It can be zip of multiple files
Response content:

301 (MOVED PERMANENTLY) or 201 (CREATED)

The request succeeded and the following resources are returned:
  • a validation report, if the Validator finds some errors;
  • a representation of the extracted metadata, if the validator doesn't find any errors.

Note


If the validation time exceeds 10 seconds, the process becomes asynchronous.

If the Accept header is “text/html”, the client receives back an HTTP Status Code 301 and is asked to perform a redirect to an incomplete summary report which, in its HTML representation, contains code that commands the browser to refresh every 5 seconds. It will stop once the report completes, because its HTML representation will no more contain the refresh command.

If the Accept header is “application/xml” or “application/json” the client will receive an entity containing the incomplete summary report and the client will have to poll the URI set in the Locator header until the report is complete

PHP client example

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
                                        
<?php

//INSPIRE Geoportal Validator Tester endpoint
$destination = "http://inspire-geoportal.ec.europa.eu/GeoportalProxyWebServices/resources/INSPIREResourceTester";

//We want the output to appear immediately to the user
disable_buffering();

//We validate a WMS endpoint
$resourceRepresentation = "http://map1.naturschutz.rlp.de/service_lanis/mod_wms/wms_getmap.php?mapfile=naturschutzgebiet&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS";


$eol = "\r\n";
$data = '';

print("Validating: '" . $resourceRepresentation . "'");
print("<br/>");
print("Please wait..." . $eol);

$mime_boundary = md5(time());

$data .= '--' . $mime_boundary . $eol;
$data .= 'Content-Disposition: form-data; name="resourceRepresentation"' . $eol . $eol;
$data .= $resourceRepresentation . $eol;
$data .= "--" . $mime_boundary . "--" . $eol; // finish with two eol's!!
$data .= $eol;

$params = array('http' => array(
        'method' => 'POST',
        'header' => 'Accept: application/xml' . $eol .
        'Content-Type: multipart/form-data; boundary=' . $mime_boundary . $eol,
        'content' => $data
        ));

$ctx = stream_context_create($params);

$response = @file_get_contents($destination, FILE_TEXT, $ctx);

//Simple XML seems a bit too picky so we massage the response a bit
$repl = str_replace('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>', '', trim($response));
$repl = str_replace("\n", '', $repl); // remove new lines
$repl = str_replace("\r", '', $repl); // remove carriage returns
$repl = trim($repl);

$xml = simplexml_load_string($repl);

$resource = $xml->getName();

$namespaces = $xml->getNameSpaces(true);
//$key_inspire_geoportal_namespace = array_search('http://inspire.ec.europa.eu/schemas/geoportal/1.0', $namespaces);
//$namespaces[$key_inspire_geoportal_namespace];

$ns_inspire_geoportal = "http://inspire.ec.europa.eu/schemas/geoportal/1.0";
$ns_inspire_common = "http://inspire.ec.europa.eu/schemas/common/1.0";

foreach ($xml->children($ns_inspire_geoportal) as $child) {
    $nodeName = $child->getName();

    if ($nodeName == "ResourceReportResource") {
        //There were issues
        print("Issues were found");
        print("<BR>");

        foreach ($child->children($ns_inspire_geoportal) as $errorNode) {
            $errorNodeName = $errorNode->getName();
            if ($errorNodeName == "InspireValidationErrors") {
                foreach ($errorNode->children($ns_inspire_geoportal) as $validationErrorNode) {
                    $validationErrorNodeName = $validationErrorNode->getName();
                    if ($validationErrorNodeName == "ValidationError") {
                        foreach ($validationErrorNode->children($ns_inspire_geoportal) as $geoportalErrorNode) {
                            $geoportalErrorNodeName = $geoportalErrorNode->getName();
                            if ($geoportalErrorNodeName == "GeoportalExceptionMessage") {
                                foreach ($geoportalErrorNode->children($ns_inspire_geoportal) as $geoportalMessageNode) {
                                    $geoportalMessageNodeName = $geoportalMessageNode->getName();
                                    if ($geoportalMessageNodeName == "Message") {
                                        $message = (string) $geoportalMessageNode;
                                        print($message);
                                        print("<BR>");
                                    }
                                }
                            }
                        }
                        //
                    }
                }
            }
        }
        break;
    } else {
        print("The resource has no validation issues and has been recognized as a: " . $nodeName);
        break;
    }
}

function disable_buffering() {
// Turn off output buffering
    ini_set('output_buffering', 'off');
// Turn off PHP output compression
    ini_set('zlib.output_compression', false);

//Flush (send) the output buffer and turn off output buffering
//ob_end_flush();
    while (@ob_end_flush());

// Implicitly flush the buffer(s)
    ini_set('implicit_flush', true);
    ob_implicit_flush(true);

//prevent apache from buffering it for deflate/gzip
    header("Content-type: text/plain");
    header('Cache-Control: no-cache'); // recommended to prevent caching of event data.

    for ($i = 0; $i < 1000; $i++) {
        echo ' ';
    }

    ob_flush();
    flush();
}
                                        
?>
    </body>
</html>
                                        

Simple Java client example


    /*
     * Simple Java Client for the INSPIRE Geoportal Validator
     *
     */
    public class InspireValidatorClient {

        URL inspireResourceTesterURL;

        InspireValidatorClient(URL inspireResourceTesterURL){
            this.inspireResourceTesterURL = inspireResourceTesterURL;

        }

        public HttpResponse validate(String resourceDescriptorText) throws UnsupportedEncodingException {
            return validate(resourceDescriptorText, null);
        }

        public HttpResponse validate(File resourceDescriptorFile) throws UnsupportedEncodingException {
            return validate(null, resourceDescriptorFile);

        }

        private HttpResponse validate(String resourceDescriptorText, File resourceDescriptorFile) throws UnsupportedEncodingException {
            HttpResponse retVal = null;

            HttpClient httpClient = new DefaultHttpClient();
            HttpPost httpPost = new HttpPost(this.inspireResourceTesterURL.toString());
            //HttpPost httpPost = new HttpPost("http://localhost:9998/INSPIREResourceTester");

            httpPost.addHeader("Accept", "application/xml");

            MultipartEntity reqEntity = new MultipartEntity();

            if (resourceDescriptorFile != null) {
                FileBody dataFile = new FileBody(resourceDescriptorFile);
                reqEntity.addPart("uploadedFile", dataFile);
            }

            if (resourceDescriptorText != null) {
                StringBody stringPart = new StringBody(resourceDescriptorText);
                reqEntity.addPart("resourceRepresentation", stringPart);
            }

            httpPost.setEntity(reqEntity);

            try {
                retVal = httpClient.execute(httpPost);
            } catch (ClientProtocolException ex) {
                System.out.println(ex.getMessage());
            } catch (IOException ex) {
                System.out.println(ex.getMessage());
            }
            return retVal;
        }

        private void printResponse(HttpResponse validatorResponse) {
            try {
                //The HTTP response status codes can be:
                //HTTP STATUS CODE 201 (Created)               - a validation report is created or just the resource representation if no issues are found
                //HTTP STATUS CODE 400 (Bad Request)           - the representation sent was not understood at all
                //HTTP STATUS CODE 500 (Internal server error) - a serious system error has occurred
                int responseStatusCode = validatorResponse.getStatusLine().getStatusCode();
                System.out.println(responseStatusCode + ": " + validatorResponse.getStatusLine().getReasonPhrase());

                if (responseStatusCode == 201) {
                    //URL of the validation report or of the resource metadata if no issues were found
                    String resultUrl = validatorResponse.getHeaders("Location")[0].getValue();

                    if (resultUrl.endsWith("resourceReport")) {
                        //Validation issues were found, hence a validation report has been generated
                        System.out.println("Validation issues were found. A report is available at the following URL:");
                        System.out.println(resultUrl);
                        System.out.println("Here is also an xml representation of the validation report:");
                    } else {
                        //No validation issues were found
                        System.out.println("No validation issues were found. The metadata information extracted is available at the following URL:");
                        System.out.println(resultUrl);
                        System.out.println("Here is also an xml representation of the metadata:");
                    }
                    //XML representation of the validation report or of the resource metadata if no issues were found
                    String xml = org.apache.commons.io.IOUtils.toString(validatorResponse.getEntity().getContent(), "UTF-8");
                    System.out.println(xml);

                }

            } catch (IOException ex) {
                System.out.println(ex.getMessage());
            }

        }
    }
                                        


Test runner for the Simple Java Client example

    /*
     * Test runner of the Simple Java Client for the INSPIRE Geoportal Validator
     *
     */
    @Test
    public void testHttpClient() throws UnsupportedEncodingException, MalformedURLException {

        URL inspireResourceTesterURL =
                new URL("http://inspire-geoportal.ec.europa.eu/GeoportalProxyWebServices/resources/INSPIREResourceTester");

        InspireValidatorClient validator = new InspireValidatorClient(inspireResourceTesterURL);

        //The resource representation can be a URL
        String strUrl =
                "http://ags-sdi-public.jrc.ec.europa.eu/arcgis/services/CCM_WGS84/MapServer/WMSServer?service=WMS&version=1.3.0&request=GetCapabilities";
        validator.printResponse(validator.validate(strUrl));

        //The resource representation can be an actual document
        String strText = "";
        validator.printResponse(validator.validate(strText));

        //The resource representation can be a file (zipped files are also accepted)
        File fileArg = new File("E:\\schemas\\altova\\mapforce\\ISOMD.xml");

        if (fileArg.isDirectory()) {
            File[] files = fileArg.listFiles();
            for (int i = 0; i < files.length; i++) {
                File file = files[i];
                validator.printResponse(validator.validate(file));
            }
        } else {
            validator.printResponse(validator.validate(fileArg));
        }
    }
                                        




Java code example with parsing of the validation report

package inspiregeoportalclient;

import eu.europa.ec.inspire.geoportal.exception.client.RemoteServiceException;
import eu.europa.ec.inspire.jaxb.GeoportalJAXBUtils;
import eu.europa.ec.inspire.schemas.geoportal._1.GeoportalResource;
import eu.europa.ec.inspire.schemas.geoportal._1.SpatialDataSetResource;
import java.util.ArrayList;
import java.util.Map;

/**
 *
 * @author quaglan
 */
public class INSPIREGeoportalValidatorSimpleJavaClient {

    static final String GEOPORTAL_WEB_SERVICES_URL = "http://inspire-geoportal.ec.europa.eu/GeoportalProxyWebServices/resources/INSPIREResourceTester";
    private INSPIREGeoportalValidatorClient validatorCommonClient;

    public INSPIREGeoportalValidatorSimpleJavaClient() {
        this(GEOPORTAL_WEB_SERVICES_URL);
    }

    public INSPIREGeoportalValidatorSimpleJavaClient(String INSPIREGeoportalTesterWebServiceURL) {
        validatorCommonClient = new INSPIREGeoportalValidatorClient(INSPIREGeoportalTesterWebServiceURL);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) throws RemoteServiceException {

        testValidateRemoteDatasetISOMetadataResource();
        testValidateRemoteDiscoveryService();
        testValidateRemoteViewService();
        testValidateCustomResource();
    }

    public static void printValidationResult(Map resultMap) {
        if (resultMap.isEmpty()) {
            System.out.println("===> Validation result: no issues found");
        } else {
            System.out.println("===> Validation result: found " + resultMap.size() + " issue(s)");

            for (Object curKey : resultMap.keySet()) {
                String metadataElementName = (String) curKey;
                ArrayList<String> curElementMsgList = (ArrayList<String>) resultMap.get(metadataElementName);
                for (String curMsg : curElementMsgList) {
                    System.out.println("        - "+ curMsg + " for metadata element " + metadataElementName);
                }
            }
        }
        System.out.println("------------------------");

    }

    public static void testValidateRemoteDatasetISOMetadataResource() {
        System.out.println("testValidateRemoteDatasetISOMetadataResource");

        INSPIREGeoportalValidatorSimpleJavaClient cli;
        cli = new INSPIREGeoportalValidatorSimpleJavaClient();

        String resourceRepresentation = "http://inspire-geoportal.ec.europa.eu/resources/INSPIRE-672c17bc-05f3-11e1-b7de-52540004b857_20121029-100526/services/1/PullResults/1-20/resources/4.iso19139.xml";

        Map resultMap = cli.getValidatorCommonClient().validate(resourceRepresentation);

        printValidationResult(resultMap);

    }

    public static void testValidateRemoteDiscoveryService() {
        System.out.println("testValidateRemoteDiscoveryService");

        INSPIREGeoportalValidatorSimpleJavaClient cli;
        cli = new INSPIREGeoportalValidatorSimpleJavaClient();

        String resourceRepresentation = "http://vap-xgeodev.jrc.ec.europa.eu/discovery/srv/eng/csw?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetRecordById&ID=f9ee6623-cf4c-11e1-9105-0017085a97ab&OUTPUTSCHEMA=http://www.isotc211.org/2005/gmd&ELEMENTSETNAME=full";

        Map resultMap = cli.getValidatorCommonClient().validate(resourceRepresentation);

        printValidationResult(resultMap);

    }

    public static void testValidateRemoteViewService() {
        System.out.println("testValidateRemoteViewService");

        INSPIREGeoportalValidatorSimpleJavaClient cli;
        cli = new INSPIREGeoportalValidatorSimpleJavaClient();

        String resourceRepresentation = "http://ags-sdi-public.jrc.ec.europa.eu/arcgis/services/CCM_WGS84/MapServer/WMSServer?request=GetCapabilities&service=WMS";

        Map resultMap = cli.getValidatorCommonClient().validate(resourceRepresentation);

        printValidationResult(resultMap);

    }

    public static void testValidateCustomResource() {
        System.out.println("testValidateCustomResource");

        INSPIREGeoportalValidatorSimpleJavaClient cli;
        cli = new INSPIREGeoportalValidatorSimpleJavaClient();

        //Build a Geoprotal resource from scratch
        GeoportalResource resource = new GeoportalResource();
        resource.setSpatialDataSetResource(new SpatialDataSetResource());
        resource.getSpatialDataSetResource().setResourceTitle("Test title");

        Map resultMap = cli.getValidatorCommonClient().validate(resource);

        printValidationResult(resultMap);

    }

    public Map validate(GeoportalResource resource) throws RemoteServiceException {
        return validate(GeoportalJAXBUtils.serializeGeoportalResource(resource));

    }

    public Map validate(String resourceRepresentation) throws RemoteServiceException {
        return validatorCommonClient.validate(resourceRepresentation);
    }

    /**
     * @return the validatorCommonClient
     */
    public INSPIREGeoportalValidatorClient getValidatorCommonClient() {
        return validatorCommonClient;
    }

    /**
     * @param validatorCommonClient the validatorCommonClient to set
     */
    public void setValidatorCommonClient(INSPIREGeoportalValidatorClient validatorCommonClient) {
        this.validatorCommonClient = validatorCommonClient;
    }
}

                                        

Groovy code example

package inspiregeoportalclient

import groovyx.net.http.HTTPBuilder;
import static groovyx.net.http.ContentType.URLENC;
import eu.europa.ec.inspire.schemas.geoportal._1.GeoportalResource
import org.apache.http.entity.mime.MultipartEntity
import static groovyx.net.http.Method.POST
import groovy.xml.XmlUtil
import javax.xml.bind.JAXBContext
import javax.xml.bind.Marshaller
import eu.europa.ec.inspire.schemas.geoportal._1.ObjectFactory
import eu.europa.ec.inspire.jaxb.GeoportalJAXBUtils
import eu.europa.ec.inspire.geoportal.exception.GeoportalException
import javax.xml.bind.JAXBElement
import eu.europa.ec.inspire.geoportal.exception.client.RemoteServiceException

/**
 *
 * @author quaglan
 */
class INSPIREGeoportalValidatorClient {

    def http

    public INSPIREGeoportalValidatorClient(String INSPIREGeoportalTesterWebServiceURL){
        http = new HTTPBuilder( INSPIREGeoportalTesterWebServiceURL )
    }

    public Map validate(GeoportalResource resource){

        return validate(GeoportalJAXBUtils.serializeGeoportalResource(resource));

    }


    public Map validate(String resourceRepresentation){
        def resultMap = [:]
        http.request( POST, 'application/xml') {
            requestContentType = 'text/plain'
            body = resourceRepresentation
            response.success = { resp2, responseRepresentation ->//println resp.statusLine //response handler for a success response code:
                //println 'Source metadata excerpt : ' + XmlUtil.serialize(sourceMetadata)[0..200] + '...'
                //def resource = XmlUtil.serialize(responseRepresentation);
                if (responseRepresentation.ResourceReportResource){
                    //It is the report resource
                    if (responseRepresentation.ResourceReportResource.InspireValidation){
                        responseRepresentation.ResourceReportResource.InspireValidationErrors.each{
                            it.ValidationError.each{
                                it.GeoportalExceptionMessage.each{
                                    def exceptionCode = it.ExceptionCode.toString()
                                    def boolean metadataElementNameFound = false
                                    it.Argument.each{
                                        if (it.ArgumentName == GeoportalException.MSG_ARG_NAME_METADATAELEMENTNAME){
                                            def elementName = it.ArgumentValue.toString()
                                            if (!resultMap[(elementName)]){
                                                def list = []
                                                resultMap.put((elementName), list)
                                                metadataElementNameFound = true
                                            }
                                            resultMap[(elementName)].add(exceptionCode)
                                        }
                                    }
                                    if (!metadataElementNameFound){
                                        def elementName = "(Document level exception)";
                                                def list = []
                                                resultMap.put((elementName), list)
                                        resultMap[elementName ].add(exceptionCode)
                                    }

                                }
                            }
                        }
                    }

                }
                //def records = new XmlSlurper().parseText(responseRepresentation)
                //def report=records.ResourceReportResource.InspireValidationErrors
                //report=report

            }
            response.failure = { resp2 ->// handler for any failure status code:
                println "Unexpected error: ${resp2.statusLine.statusCode} : ${resp2.statusLine.reasonPhrase}"
                throw new RemoteServiceException("Unexpected error: ${resp2.statusLine.statusCode} : ${resp2.statusLine.reasonPhrase}");
            }
        }
        return resultMap
    }
}
                                        

curl client example

In all the examples the “-o” option can be added to save the result to a local file.

Passing free text

curl -i -H "Accept: application/xml" --header "Content-Type:text/plain" --data "ddd" \
     http://inspire-geoportal.ec.europa.eu/GeoportalProxyWebServices/resources/INSPIREResourceTester
                                                        

Passing a url to a GetRecords request and asking for the response to be delivered in json format

curl -i -H "Accept: application/xml" --header "Content-Type:text/plain"  \
     --data "http://nationaalgeoregister.nl/geonetwork/srv/dut/inspire?request=GetRecords&service=CSW&version=2.0.2&resultType=results&namespace=xmlns%28csw=http://www.opengis.net/cat/csw/2.0.2%29,xmlns%28gmd=http://www.isotc211.org/2005/gmd%29&outputFormat=application/xml&outputSchema=http://www.isotc211.org/2005/gmd&startPosition=1&maxRecords=1&elementSetName=full&constraintLanguage=FILTER&constraint_language_version=1.1.0&typeNames=gmd:MD_Metadata"  \
     http://inspire-geoportal.ec.europa.eu/GeoportalProxyWebServices/resources/INSPIREResourceTester
                                                        

Passing a file containing an ISO 19139 metadata

curl -i -H "Accept: application/xml" --header "Content-Type:text/plain" --data "@iso19139.xml"   \
     http://inspire-geoportal.ec.europa.eu/GeoportalProxyWebServices/resources/INSPIREResourceTester
                                                        

The "-L" parameter is necessary because it must perform redirects:

Passing free text


curl -L -i -H "Accept: application/xml" --form resourceRepresentation="dd"  \
     http://inspire-geoportal.ec.europa.eu/GeoportalProxyWebServices/resources/INSPIREResourceTester
                                                        

Passing a text which is a url to a GetRecords request and asking for the response to be delivered in json format

curl -L -i -H "Accept: application/json" --form  \
     resourceRepresentation="http://nationaalgeoregister.nl/geonetwork/srv/dut/inspire?request=GetRecords&service=CSW&version=2.0.2&resultType=results&namespace=xmlns%28csw=http://www.opengis.net/cat/csw/2.0.2%29,xmlns%28gmd=http://www.isotc211.org/2005/gmd%29&outputFormat=application/xml&outputSchema=http://www.isotc211.org/2005/gmd&startPosition=1&maxRecords=1&elementSetName=full&constraintLanguage=FILTER&constraint_language_version=1.1.0&typeNames=gmd:MD_Metadata"  \
     http://inspire-geoportal.ec.europa.eu/GeoportalProxyWebServices/resources/INSPIREResourceTester
                                                        

Passing a file containing an ISO 19139 metadata

curl -L -i -H "Accept: application/xml"  \
     --form "uploadedFile=@iso19139.xml" \
     http://inspire-geoportal.ec.europa.eu/GeoportalProxyWebServices/resources/INSPIREResourceTester
                                                        

Python client example

The code is hosted on GitHub and has been contributed by Tom Kralidis

XML schemas

The validation result can be requested in machine readable format.

The structure of the validation results is governed by XML schemas that are published at

http://inspire-geoportal.ec.europa.eu/schemas/inspire/geoportal/1.0/geoportal.xsd