I am trying to load a WFS from GeoServer. My GeoServer service is at localhost:8080 and my web server at localhost:80. Since there is the issue of cross domain and firebug is showing:

XMLHttpRequest cannot load http://localhost:8080/geoserver/wfs. 
Origin http://localhost is not allowed by Access-Control-Allow-Origin

I have created a proxy.cgi following http://www.gistutor.com/geoserver/21-intermediate-geoserver-tutorials/38-configuring-geoserver-proxy-for-public-and-remote-data-access.html. But when I go to http://localhost/cgi-bin/proxy.cgi its giving me the OpenLayers site, and when there is no proxy and just leading to http://localhost/xampp, when there is a proxy (here proxy is my institute proxy to connect to internet)..

My problem is I am able to load the data from GeoServer successfully (as if everything is fine) but firebug is showing:

"POST *http://localhost/cgi-bin/proxy.cgi?url=http%3A%2F%2Flocalhost%3A8080%2Fgeoserver%2Fwfs undefined (undefined)". 

I am including OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url="; in my JavaScript and also:

protocol: new OpenLayers.Protocol.WFS({
            version: "1.0.0",
            srsName: "EPSG:4326", // this is the default
            url:  "http://localhost:8080/geoserver/wfs",
            featureType: "states",
            featureNS: "http://www.openplans.org/topp"

I want to know why it's working fine but still giving me the error, What is the error about and how can I to fix it?

  • 1
    @user1975 please only link to public urls - hyperlinking localhost is not useful to GISse users here. If you can put the application on a public url (webserver) where it is much easier to debug. (I removed the local hyperlinks...) – Mapperz May 27 '11 at 14:36
  • @Mapperz, thanks for informing, will not repeat this – Vikash Talanki May 27 '11 at 16:02
  • try using the full IP address of your 'localhost' - also try from another machine (i use remote desktop to do this) – Mapperz May 27 '11 at 16:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.