Hi,
as far as I can see JSON exception encoding is not uniformly implemented
across
all protocols.
I was actually surprised to see it's there at all for WFS, given that the
protocol, unlike WMS, has
no notion of alternative exception encoding formats.
But it turns out, it's actually available for WFS 1.0 and WFS 1.1, as long
as the request contains
a EXCEPTIONS parameter in the URL, but not in WFS 2.0, which is the one
that you are using.
Check this out:
http://demo.geo-solutions.it/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=not_there&maxFeatures=50&exceptions=application/json
(works)
http://demo.geo-solutions.it/geoserver/ows?service=WFS&version=1.1.0&request=GetFeature&typeName=not_there&maxFeatures=50&exceptions=application/json
(works)
http://demo.geo-solutions.it/geoserver/ows?service=WFS&version=2.0.0&request=GetFeature&typeName=not_there&maxFeatures=50&exceptions=application/json
(does not work)
Feel free to open a request for improvement at
https://osgeo-org.atlassian.net/projects/GEOS
Cheers
Andrea
On Tue, Dec 20, 2016 at 10:56 AM, Niklas Trzaska <
[email protected]> wrote:
> Dear reader,
>
> I am new to GeoServer, so I hope I have come to the right place.
>
> I am using GeoServer 2.10.0, running on Ubuntu 16.04 LTS.
>
> I try to get exceptions as JSON, so I use the query parameter
> EXCEPTIONS=application/json (as written here for WFS:
> http://docs.geoserver.org/stable/en/user/services/wfs/reference.html or
> here for WMS: http://docs.geoserver.org/stable/en/user/services/
> wms/reference.html)
>
> If I perform an invalid request for a WMS, I successfully receive an error
> in JSON:
> ***********************************************************
> ************************************************************
> **************************
> -EXAMPLE:
> ***********************************************************
> ************************************************************
> **************************
> http://localhost:8080/geoserver/test/wms?SERVICE=
> wms&VERSION=1.3.0&REQUEST=GetMap&EXCEPTIONS=application/json
>
> {
> "version": "1.3.0",
> "exceptions": [
> {
> "code": "MissingOrInvalidParameter",
> "locator": "noLocator",
> "text": "Missing or invalid requested map size. Parameters WIDTH and
> HEIGHT shall be present and be integers > 0. Got WIDTH=0, HEIGHT=0"
> }
> ]
> }
> ***********************************************************
> ************************************************************
> **************************
>
>
>
> But the request parameter does not work for WFS, in my case.
>
>
> ***********************************************************
> ************************************************************
> **************************
> -EXAMPLE:
> ***********************************************************
> ************************************************************
> **************************
> http://localhost:8080/geoserver/test/wfs?SERVICE=
> wfs&VERSION=2.0.0&REQUEST=GetFeature&TYPENAMES=
> INVALIDTYPENAME&outputFormat=application/json&EXCEPTIONS=application/json
>
> <ows:ExceptionReport xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/
> 2001/XMLSchema-instance" version="2.0.0" xsi:schemaLocation="http://
> www.opengis.net/ows/1.1 http://localhost:8080/geoserver/schemas/ows/1.1.0/
> owsAll.xsd">
> <ows:Exception exceptionCode="InvalidParameterValue"
> locator="typeName">
> <ows:ExceptionText>Feature type :INVALIDTYPENAME
> unknown</ows:ExceptionText>
> </ows:Exception>
> </ows:ExceptionReport>
> ***********************************************************
> ************************************************************
> **************************
>
> Unfortunately I was not able to find a solution. So I would like to ask
> for your advice.
> I would be happy if someone could point out the source of the error.
>
> Kind regards
> Niklas
>
>
> ------------------------------------------------------------
> ------------------
> Developer Access Program for Intel Xeon Phi Processors
> Access to Intel Xeon Phi processor-based developer platforms.
> With one year of Intel Parallel Studio XE.
> Training and support from Colfax.
> Order your platform today.http://sdm.link/intel
> _______________________________________________
> Geoserver-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------------------------------------------------
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/intel
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users