Is it possible to catch Raise Warning, Raise Notice and Raise Exception in OpenLayers while using a WFS-T-Layer (stored in a PostGIS-Database) to save edits? Example: A trigger is used to check values or check Intersections/Overlaps and gives back warnings or exceptions that are displayed in alerts/popups to give some feedback to the user.


Actually I'm not sure if the SaveStrategy of OpenLayers can catch these notices.

In the OGC specification is written:

Individual exception messages are contained within the <ExceptionText> element. The mandatory code attribute may be used to associate an exception code with the accompanying message. The optional locator attribute may be used to indicate where an exception was encountered in the request that generated the error.

If you wrote sucessfully to your wfs-t-service you normally get back something like this:

<?xml version="1.0" encoding="UTF-8"?>
<wfs:TransactionResponse version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs http://web-mapping.com:8080/geoserver/schemas/wfs/1.1.0/wfs.xsd"
            <ogc:FeatureId fid="shape_flurstuecke.457"/>

I am not 100% sure (as i haven't tested it yet) but I guess that a raise notice message would not even be included in this wfs response. In this case OpenLayers would have no chance to catch this message.

One option aside the OGC-standards would be PHP: Have a look at http://php.net/manual/de/function.pg-last-notice.php

The nicest solution would be to have a websocket connection and to "push" notices, warnings and exceptions through the websocket connection from the server to the client ;)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.