OpenLayers GeoServer Cross Origin Issue

I am trying to make a WMS GetFeatureInfo request from an openlayers based application in GeoServer. But I am facing the issue of the origin of the cross as it knows my origin is http: localhost.

Hope someone can help me, here is my setup

I have a geoserver installed on a windows server with IP xxxx accessed through port 8080. I have an openlayers app installed locally in IIS 7.5 and I am linking to it with

http://localhost/Application/Application.html

      

On the GeoServer I configured the following

GeoServer is installed as part of GeoSuite v2.2, it uses the Jetty web service. The GeoServer Proxy Extension is installed. ( http://geoserver.org/display/GEOS/GeoServer+Proxy+Extension ).

I set up the rest of the proxy to use anonymous authentication. I had to do this in the config.xml file as there is a bug in this version of GeoServer administration that stops saving the authentication filter. I also ensured that the rest.properties fileit is configured for anonymous authentication. In the proxy config I allowed localhost

In openlayers app, I have set proxy setting like this

OpenLayers.ProxyServer = "http://x.x.x.x:8080/geoserver/rest/proxy?url="

      

This still doesn't work, I still get the cross problem. I have not installed the Base Proxy Url workspace geoserver as I am not sure if this is relevant. Do I need to install this? If so, what?

If someone has solved this please let me know

All help is appreciated.

+3


source to share


2 answers


As mentioned above, you will need to create a proxy server in IIS. How you do it can vary greatly, there are many ways to do this. Here's a pre-installed proxy for simplicity. It should be pretty easy for Google if you need it. They are ten dozen.



The great news is that GeoServer 2.3 Beta supports JSONP for GetFeatureInfo requests. http://blog.geoserver.org/2013/01/29/geoserver-2-3-beta-released/ If you are good at checking bleeding edge this is the way to go. You don't need a proxy anymore.

0


source


For me, I'm using PHP Curl to work as a proxy, not to set it up, just PHP Curl pages, then everything is fine, no fussy setup.;)



Regards, Nas

-1


source







All Articles