Parsing WMTSGetCapabilitiesResponse fails for ows:Profile

Description

Parsing/validation of a WMTS GetCapabilities Response XML document fails if the ows:ServiceIdentification section contains one or more owsrofile entries.

I have found this issue in the Geoserver context when I have tried to cascade an external WMTS service (see http://docs.geoserver.org/latest/en/user/data/cascaded/wmts.html). Geoserver failed to parse the GetCapabilities file (including owsrofile) returned by the WMTS server which seems to be valid from my point of view.

After checking the Geoserver stack trace I have noticed that the source of this issue seems to be a validation issue in the GeoTools class org.geotools.data.wmts.response.WMTSGetCapabilitiesResponse#parse.

It is easy to reproduce this issue using a simple GeoTools code snipped (Similar to the code in the parse methode of the WMTSGetCapabilitiesResponse class) together with the file modules/ogc/net.opengis.wmts/schemas/wmts/1.0.1/profiles/wmts-simple/examples/wmtsGetCapabilities_response_CRS84.xml from the GeoTools Git repo.
If the <owsrofile> entry is removed from wmtsGetCapabilities_response_CRS84.xml it works otherwise a RuntimeException is thrown.

This code throws the following exception:

Environment

None

Status

Assignee

Ian Turton

Reporter

MarcN

Triage

None

Components

Affects versions

Priority

High
Configure