2

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?

  • Do you have CORS support? Is that port open on the host firewall (assuming the QGIS access is local)? – BradHards Feb 11 '14 at 10:28
  • Sorry I have no idea what CORS is and i don't have full access to the server, only to the Geoserver Web-interface. But yes, Qgis is local on my machine and Geoserver is on a remote server – Stéphane Henriod Feb 11 '14 at 10:33
1

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!

0

Geoserver has specific details to be taken into account, try these posts:

  • Thx, I had already seen those 2 posts. All seem correct in the config of Geoserver (the workspace URI is the same as the featureNS in the code); hte geometry column is correctly specified – Stéphane Henriod Feb 11 '14 at 10:37
  • have you tried ´thething.disco.unimib.it:12080/geoserver/wfs´ in your browser? it gives an error, and afaik it shouldn't. – Gery Feb 11 '14 at 13:39
  • It indeed returns an exception: Could not determine geoserver request from http request org.geoserver.platform.AdvancedDispatchFilter$AdvancedDispatchHttpRequest@fe23fb1 But I still don't see what's wrong here... – Stéphane Henriod Feb 11 '14 at 14:19
  • Geoserver doesn't have a log error file or something like that where error can be tracked down? – Gery Feb 11 '14 at 15:39
  • I don't know cause I don't have access to the server itself. I just asked the server admin and will let you know if I find something interesting – Stéphane Henriod Feb 11 '14 at 16:33

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.