|
17 | 17 | import java.time.Instant; |
18 | 18 | import java.util.ArrayList; |
19 | 19 | import java.util.List; |
| 20 | +import java.util.Map; |
20 | 21 | import java.util.Objects; |
21 | 22 | import java.util.Optional; |
22 | 23 | import java.util.Set; |
|
33 | 34 | import org.geotools.ows.wms.WebMapServer; |
34 | 35 | import org.geotools.ows.wmts.WebMapTileServer; |
35 | 36 | import org.geotools.ows.wmts.model.WMTSLayer; |
| 37 | +import org.geotools.xml.DocumentFactory; |
36 | 38 | import org.slf4j.Logger; |
37 | 39 | import org.slf4j.LoggerFactory; |
38 | 40 | import org.springframework.beans.factory.annotation.Autowired; |
@@ -293,10 +295,15 @@ private void addLayerRecursive( |
293 | 295 | } |
294 | 296 | } |
295 | 297 |
|
296 | | - void loadWMSCapabilities(GeoService geoService, ResponseTeeingHTTPClient client) throws Exception { |
| 298 | + private void loadWMSCapabilities(GeoService geoService, ResponseTeeingHTTPClient client) throws Exception { |
297 | 299 | WebMapServer wms; |
298 | 300 | try { |
299 | | - wms = new WebMapServer(new URI(geoService.getUrl()).toURL(), client); |
| 301 | + wms = new WebMapServer( |
| 302 | + new URI(geoService.getUrl()).toURL(), |
| 303 | + client, |
| 304 | + Map.of( |
| 305 | + // allow DTD for WMS 1.1.x |
| 306 | + DocumentFactory.ENABLE_DTD, true)); |
300 | 307 | } catch (ClassCastException | IllegalStateException e) { |
301 | 308 | // The gt-wms module tries to cast the XML unmarshalling result expecting capabilities, but a |
302 | 309 | // WMS 1.0.0/1.1.0 ServiceException may have been unmarshalled which leads to a |
@@ -380,7 +387,7 @@ void loadWMSCapabilities(GeoService geoService, ResponseTeeingHTTPClient client) |
380 | 387 | Set.of()); |
381 | 388 | } |
382 | 389 |
|
383 | | - void loadWMTSCapabilities(GeoService geoService, ResponseTeeingHTTPClient client) throws Exception { |
| 390 | + private void loadWMTSCapabilities(GeoService geoService, ResponseTeeingHTTPClient client) throws Exception { |
384 | 391 | WebMapTileServer wmts = new WebMapTileServer(new URI(geoService.getUrl()).toURL(), client); |
385 | 392 | setServiceInfo(geoService, client, wmts); |
386 | 393 |
|
|
0 commit comments