[GIS] WFS layer doesn’t display in OpenLayers2

geoserveropenlayers-2wfs

I have a few layers in a PostGIS database that I serve through GeoServer and that I try to display in OpenLayers.

When I had the GeoServer installed on localhost, it worked flawlessly. Now that I migrated the GeoServer on a remote server, the WFS is no longer displayed on my OpenLayers map.

Looking at Firebug, the request is sent to the server but no answer is received.

What is even weirder is that I can access the WFS from QGIS without any problem. Also, even the Geoserver examples (WMS though) work perfectly.

The page is here: http://www.henriod.info/khub2/khub2.html

Do you see any problem with this part of the code?

 var schools = new OpenLayers.Layer.Vector("Schools", {
               styleMap: style_schools,
               strategies: [new OpenLayers.Strategy.BBOX()],
               projection: new OpenLayers.Projection("EPSG:4326"),
               protocol: new OpenLayers.Protocol.WFS({
               version: "1.1.0",
                               url:  "http://thething.disco.unimib.it:12080/geoserver/wfs",
               featurePrefix: "humadat",
               featureNS: "http://thething.disco.unimib.it:12080/geoserver/khub2",
                               featureType: "schools",
               geometryName: "the_geom"
                           })
            });

Or could the problem be somewhere else?

Best Answer

So here is the answer: the OpenLayers script works correctly and the problem was caused by a proxy on the server not passing the arguments correctly to Geoserver. Some config there solved the issue. Thanks to all who tried to help!