3

I am having trouble getting a WFS layer working using Geoserver, OpenLayers and GeoExt.

I get the following error:

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

Does anyone know how I get around this? I can't find anything in the examples for geoserver, openlayers or geoext.

I don't get any errors when using WMS on my maps.

Many thanks,

James

1
  • I use IIS for displaying maps and i have also this error what can i do ?
    – ROCHEDY
    Feb 11, 2013 at 11:15

2 Answers 2

6

I think this is this problem http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#ProxyHost

so you need to set up a proxy host as per those instructions.

5
  • Thanks for that. It has removed that error. Now I just have to find out why my data isn't showing on the map.
    – James S
    Sep 24, 2010 at 11:44
  • 1
    There are some really useful tools in firefox for debugging wms/wfs requests- if you don't already know about them. Try firebug and httpfox- that way you will see the actual request being sent to your server. Sep 24, 2010 at 13:30
  • Thanks for the links those two - I shall try them out to see if they help.
    – James S
    Sep 24, 2010 at 13:52
  • I have added a proxy file but I am not sure what I need to put in it to make it work. My layer will work within QGIS so I am guessing it is a proxy problem or something like that.
    – James S
    Oct 13, 2010 at 9:45
  • Were you able to get this working? I am still facing the same problem and have no clue how to solve it
    – Sam007
    May 22, 2012 at 23:18
-1

Requests between domains is not allowed for XMLhttprequest stuff. Requesting JSONP as outputformat might also by a solution to. this not in the official OGC-spec, but Geoserver supports this. But I don't know if openlayers supports jsonp. (there is a plugin for leaflet that does ) See: http://docs.geoserver.org/latest/en/user/services/wfs/outputformats.html

1
  • Your Answer doesn't solve the issue. It can only be solved with a proxy file as given in the accepted answer. Feb 11, 2013 at 13:13

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.