Search code examples
exceptiongeoserverwms

how to change Geoserver 2.8.2 WMS exception format


I want to change the exception format of Geoserver 2.8.2 WMS from default XML to inimage or blank. The docu states that this is possible (https://docs.geoserver.org/latest/en/user/services/wms/reference.html#exceptions), but does not tell how or where. Could anybody please tell me?

Thanks in advance!


Solution

  • The format can be changed only while performing a GetMap request (it cannot be configured, I believe the standard mandates the usage of XML exceptions by default).

    When issuing a GetMap request, add the key value pair &EXCEPTIONS=application/vnd.ogc.se_inimage or &EXCEPTIONS=application/vnd.ogc.se_blank in the URL.

    E.g.:

    https://gs-main.geosolutionsgroup.com/geoserver/tiger/wms?service=WMS&version=1.1.0&request=GetMap&layers=tiger%3Agiant_polygon&bbox=-180.0%2C-90.0%2C180.0%2C90.0&width=768&height=384&srs=EPSG%3A4326&styles=foobar&format=image/png&EXCEPTIONS=application/vnd.ogc.se_inimage

    (should return an image saying that the foobar style does not exist)