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?

til
8946 silver badges12 bronze badges
asked Feb 11, 2014 at 10:19
2
  • Do you have CORS support? Is that port open on the host firewall (assuming the QGIS access is local)? Commented Feb 11, 2014 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 Commented Feb 11, 2014 at 10:33

2 Answers 2

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!

answered Feb 12, 2014 at 7:21
0

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

answered Feb 11, 2014 at 10:31
7
  • 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 Commented Feb 11, 2014 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. Commented Feb 11, 2014 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... Commented Feb 11, 2014 at 14:19
  • Geoserver doesn't have a log error file or something like that where error can be tracked down? Commented Feb 11, 2014 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 Commented Feb 11, 2014 at 16:33

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.