geoserver – Resolving GeoServer Returning Incorrect WMS URL from a DescribeLayer Request from TerriaJS

geoserverterriajswfswms

We are building a TerriaJS application that should be making OGC WMS requests to our GeoServer through a proxy we have developed. TerriaJS successfully makes a GetCapabilities call to our GeoServer as seen:

https://www.TERRIA-APP.co.uk/proxy/_1d/https://www.GEOSERVER-PROXY.com/v1/wms?service=WMS&request=GetCapabilities&version=1.3.0&tiled=true

This returns back fine and the data layers are loaded into Terria.
Once, I click on a layer from the TerriaJS app, it launches a DescribeLayer request as such:

https://www.TERRIA-APP.co.uk/proxy/_1d/https://www.GEOSERVER-PROXY.com/v1/wms?service=WMS&version=1.1.1&sld_version=1.1.0&request=DescribeLayer&layers=LAYER-GROUP%3ALAYER

This request goes fine to the GeoServer, but the error seems to be what is being returned back to the TerriaJS application from this DescribeLayer call which returns:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE WMS_DescribeLayerResponse SYSTEM "https://www.TERRIA-APP.co.uk/v1/wms?/schemas/wms/1.1.1/WMS_DescribeLayerResponse.dtd">
<WMS_DescribeLayerResponse version="1.1.1">
    <LayerDescription name="LAYER-GROUP:LAYER" wfs="https://www.TERRIA-APP.co.uk/v1/wms?/wfs&amp;" 
                                                               owsURL="https://www.TERRIA-APP.co.uk/v1/wms?/wfs&amp;" owsType="WFS">
    <Query typeName="LAYER-GROUP:LAYER"/>
  </LayerDescription>
</WMS_DescribeLayerResponse>

This URL doesn't make sense and is what seems to be causing the error:

https://www.TERRIA-APP.co.uk/v1/wms?/wfs&amp

So my confusions here:

  1. Why is the DescribeLayer returning a WFS URL when I'm specifically asking for WMS. Also, WFS is turned off in the GeoServer so why is it assuming WFS?
  2. Is it TerriaJS or GeoServer that is appending the /wfs&amp after the path?
  3. We have used this GeoServer proxy with other applications such as : OpenLayers, QGIS and ESRI Web App Builder without any problems, so what's different with TerriaJS?
  4. Why does a GetMap Request never launch from the TerriaApp (I can see in the network tab that there is only DescribeLayers and GetLegendGraphic which both run successfully. So we can never actually see anything on the map?

Best Answer

  1. A DescribeLayer request is supposed to return a link to a WFS layer, see the manual:

The DescribeLayer operation is used primarily by clients that understand SLD-based WMS. In order to make an SLD one needs to know the structure of the data. WMS and WFS both have operations to do this, so the DescribeLayer operation just routes the client to the appropriate service.

  1. I suspect that is GeoServer, and it leads me to suspect that you have set the proxy base URL to include v1/wms?

  2. No idea, since DescribeLayer is optional not many clients use it.

  3. No idea, you need to ask the developers of TerriaApp

Related Question