Ticket #2444 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

WFS 1.0.0 GetFeature response when no feature is found must be null

Reported by: nsavard Owned by: tomkralidis
Priority: normal Milestone: 5.2 release
Component: WFS Server Version: 5.0
Severity: normal Keywords: OGC,Cite,TEAM,WFS 1.0.0
Cc: assefa

Description

When a GetFeature? is issued to a WFS 1.0.0 server and that no feature is found, the response from this server must be null instead of an exception.

This is some information here:

 http://mail.opengeospatial.org/pipermail/wfs-dev/2003-January/000098.html


Actual response from the server is:

<ServiceExceptionReport? xmlns=" http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ogc  http://schemas.opengis.net/wms/1.1.1/OGC-exception.xsd">

<ServiceException?>

msQueryByRect(): Search returned no results. No matching record(s) found.

</ServiceException>

</ServiceExceptionReport>


The request sent is:  http://dev1.lan.mapgears.com/manwe/cgi-bin/mswfs100_ogc_cite? &service=WFS&version=1.0.0&request=GetFeature?&typename=cgf:Points& filter=%3Cogc%3AFilter+xmlns%3Aogc%3D%22 http%3A%2F%2Fwww.opengis.net%2Fogc%22+xmlns%3Agml%3D%22 http%3A%2F%2Fwww.opengis.net%2Fgml%22%3E%3Cogc%3ABBOX%3E%3C ogc%3APropertyName%3Egml%3ApointProperty%3C%2F ogc%3APropertyName%3E%3Cgml%3ABox+xmlns%3D%22 http%3A%2F%2Fwww.opengis.net%2Fcite%2FspatialTestSuite%22+ srsName%3D%22EPSG%3A32615%22%3E%3Cgml%3A coordinates%3E500100%2C500000+500200%2C500100%3C%2Fgml%3A coordinates%3E%3C%2Fgml%3ABox%3E%3C%2Fogc%3ABBOX%3E%3C%2F ogc%3AFilter%3E

Change History

Changed 6 years ago by dmorissette

  • milestone set to 5.2 release

Changed 6 years ago by nsavard

  • keywords OGC,Cite,TEAM,WFS 1.0.0 added

Changed 5 years ago by tomkralidis

  • cc assefa added
  • owner changed from mapserverbugs to tomkralidis
  • status changed from new to assigned

Norm: I can't reproduce an exception for the case above. Can you try again and verify?

I did emulate this behaviour when a filter is applied (r7682), so that exception is not returned for no results, just gml:null.

Changed 5 years ago by assefa

Tom,

I had this fix as part of #2451 but I forgot to commit mapwfs.c. Just realized when I got a conflict.

I think we should generate "real" error messages if they happen to be different from "Search returned no results". here is the code:

if( FLTApplyFilterToLayer(psNode, map, iLayerIndex, MS_FALSE) != MS_SUCCESS )

{

ms_error = msGetErrorObj();

if(ms_error->code != MS_NOTFOUND) {

msSetError(MS_WFSERR, "FLTApplyFilterToLayer() failed", "msWFSGetFeature()", pszFilter); return msWFSException(map, "mapserv", "NoApplicableCode?", paramsObj->pszVersion);

}

}

I will commit if you do not see any issues. I realize not why we had a different result when running that autotest.

Changed 5 years ago by tomkralidis

Assefa: if the result above is due to a failure in FLTApplyFilterToLayer(), then that's fine, and go ahead.

Changed 5 years ago by assefa

Applied in r7689

Changed 5 years ago by tomkralidis

Thanks Assefa. Norm: can you test and verify?

Changed 5 years ago by nsavard

Tom: Yes, I'll check this morning and come back to you.

Changed 5 years ago by nsavard

Fixed.

Relevant tests were: wfs:test1.0.0-basic-getfeature-filter-spatialoperators-bbox-get-13 to 18 (s0008) wfs:test1.0.0-basic-getfeature-filter-spatialoperators-bbox-post-13 to 18 (s0008)

All these tests passed now.

Changed 5 years ago by tomkralidis

  • status changed from assigned to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.