Something is seriously wrong with the WFS implementation in Geoserver 2.5.
I loaded a dataset into SQL Server and PostGIS. The dataset consists of a few points and is in native EPSG:3857.
The Geometry_Columns table is set for the SQL Server connection and everything appears to be fine in the Geoserver setup.
However, trying to access the WFS through OpenLayers:
WFS 1.0.0 | GET | Fixed | SQL Server > OK
WFS 1.0.0 | GET | Fixed | PostGIS > OK
WFS 1.0.0 | POST | Fixed | SQL Server > OK
WFS 1.0.0 | POST | Fixed | PostGIS > OK
WFS 1.0.0 | GET | BBOX | SQL Server > Fail
WFS 1.0.0 | GET | BBOX | PostGIS > OK
WFS 1.0.0 | POST | BBOX | SQL Server > Fail
WFS 1.0.0 | POST | BBOX | PostGIS > Fail
WFS 1.1.0 | GET | Fixed | SQL Server > OK (but not displayed on map)
WFS 1.1.0 | GET | Fixed | PostGIS > OK (but not displayed on map)
WFS 1.1.0 | POST | Fixed | SQL Server > OK
WFS 1.1.0 | POST | Fixed | PostGIS > OK
WFS 1.1.0 | GET | BBOX | SQL Server > Fail
WFS 1.1.0 | GET | BBOX | PostGIS > OK (but not displayed on map)
WFS 1.1.0 | POST | BBOX | SQL Server > Fail
WFS 1.1.0 | POST | BBOX | PostGIS > Fail
The only BBOX filtered request which succeeds is 1.0.0 GET on PostGIS datasource.
The GeoServer is publicly accessible if someone would like to run the tests for themselves. Any advice is welcome. I really need to get this working with SQL Server.
http://developer.system-ns.net:8080/geoserver/MobileSurvey/ows?service=WFS&request=getcapabilities
Here is how I call the WFS from Openlayers 2.13 as a POST request:
var wfsLayer = new OpenLayers.Layer.Vector('CATASTRO', {
projection: 'EPSG:3857',
strategies: [new OpenLayers.Strategy.Fixed()],
protocol: new OpenLayers.Protocol.WFS({
version: '1.0.0',
url: 'http://developer.system-ns.net:8080/geoserver/MobileSurvey/wfs',
srsName: 'EPSG:3857',
featurePrefix: 'MobileSurvey',
featureType: 'CATASTRO_SQL3857',
geometryName: 'GEOMETRY',
featureNS: 'http://argeomatica.com/MobileSurvey'
})
});
This is the SQL Server datasource. Change the featureType to 'catastro_pg3857' for the PostGIS datasource. I switch the strategy from Fixed to BBOX, and the version between '1.0.0' and '1.1.0' for the different tests.
Here is my GET request:
var wfsOptions = {
url: 'http://developer.system-ns.net:8080/geoserver/MobileSurvey/ows?',
params: {
request: 'GetFeature',
service: 'WFS',
version: '1.0.0',
typeName: 'catastro_pg3857',
srsName: 'EPSG:3857'
},
format: new OpenLayers.Format.GML({
featureNS: 'http://argeomatica.com/MobileSurvey',
geometryName: 'GEOMETRY'
})
}
wfsLayer = new OpenLayers.Layer.Vector('CATASTRO', {
projection: 'EPSG:3857',
strategies: [new OpenLayers.Strategy.BBOX()],
visibility: true,
protocol: new OpenLayers.Protocol.HTTP(wfsOptions)
});
Cheers, Dennis