Maybe this is a dumb question but how do people manage this in production? I looked at this web site: <a href="http://taossa.com/index.php/2007/02/08/same-origin-policy/">http://taossa.com/index.php/2007/02/08/same-origin-policy/</a> that says that the policy looks at the port number. Right now I have my geoserver instance on the below server at port 8080 and my webapp serving the geo web pages sits on the same host on port 8082. I eventually want to have my geoserver on one machine and my webserver serving up the webpages on a different machine, I can't see how I can do this given this policy (I don't see the proxy script as a production solution).<br>
<br>thanks,<br><br>Alessandro Ferrucci<br><br><div class="gmail_quote">On Tue, Oct 27, 2009 at 7:36 PM, Christopher Schmidt <span dir="ltr"><<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="h5">On Tue, Oct 27, 2009 at 02:18:42PM -0400, Alessandro Ferrucci wrote:<br>
> Hello,<br>
> I'm attempting to call getFeatureInfo from Openlayers to a geoserver<br>
> instance.<br>
><br>
> Rigth now all I do is construct a GetFeatureInfo URL and supply that URL to<br>
> a window.open method and it works fine, below is relevant code:<br>
><br>
> var wmsurl = "<a href="http://dialga.npc.census.gov:8080/geoserver/wms" target="_blank">http://dialga.npc.census.gov:8080/geoserver/wms</a>";<br>
><br>
> map.events.register('click', map, function (e) {<br>
> var url = wmsurl + "?REQUEST=GetFeatureInfo" +<br>
> "&EXCEPTIONS=application/vnd.ogc.se_xml"<br>
> + "&BBOX=" + map.getExtent().toBBOX()<br>
> + "&X=" + e.xy.x<br>
> + "&Y=" + e.xy.y<br>
> + "&INFO_FORMAT=text/html"<br>
> + "&QUERY_LAYERS=cira:addresses"<br>
> + "&LAYERS=cira:addresses"<br>
> + "&FEATURE_COUNT=50"<br>
> + "&SRS=EPSG:900913"<br>
> + "&STYLES="<br>
> + "&WIDTH=" + map.size.w<br>
> + "&HEIGHT=" + map.size.h;<br>
><br>
> window.open(url, "getfeatureinfo",<br>
> "location=0,status=0,scrollbars=1,width=600,height=150" );<br>
> });<br>
><br>
> But now I want to be able to use OpenLayers.loadURL method to make an AJAX<br>
> request to the geoserver instance and get back the XMLHttpRequest obejct and<br>
> extract the HTMl from the responseText member.<br>
><br>
> this is the code:<br>
><br>
> var wmsurl = "<a href="http://dialga.npc.census.gov:8080/geoserver/wms" target="_blank">http://dialga.npc.census.gov:8080/geoserver/wms</a>";<br>
><br>
> map.events.register('click', map, function (e) {<br>
> var url = wmsurl<br>
> + "?REQUEST=GetFeatureInfo"<br>
> + "&EXCEPTIONS=application/vnd.ogc.se_xml"<br>
> + "&BBOX=" + map.getExtent().toBBOX()<br>
> + "&X=" + e.xy.x<br>
> + "&Y=" + e.xy.y<br>
> + "&INFO_FORMAT=text/html"<br>
> + "&QUERY_LAYERS=cira:addresses"<br>
> + "&LAYERS=cira:addresses"<br>
> + "&FEATURE_COUNT=50"<br>
> + "&SRS=EPSG:900913"<br>
> + "&STYLES="<br>
> + "&WIDTH=" + map.size.w<br>
> + "&HEIGHT=" + map.size.h;<br>
><br>
><br>
> OpenLayers.loadURL(url,'',this,receiveGetFeatureInfo,receiveGetFeatureInfo);<br>
> });<br>
><br>
> function receiveGetFeatureInfo(response)<br>
> {<br>
> alert("RESPONSE TEXT: " + response.responseText);<br>
> }<br>
><br>
> responseText is ALWAYS empty... am I doing something wrong?<br>
<br>
</div></div>Violating the Same Origin Policy.<br>
<br>
<a href="http://faq.openlayers.org/proxyhost/all/" target="_blank">http://faq.openlayers.org/proxyhost/all/</a><br>
<div class="im"><br>
> Thank you very much,<br>
><br>
><br>
> --<br>
> Signed,<br>
> Alessandro Ferrucci<br>
<br>
</div><div><div></div><div class="h5">> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
> <a href="http://openlayers.org/mailman/listinfo/users" target="_blank">http://openlayers.org/mailman/listinfo/users</a><br>
<br>
<br>
--<br>
</div></div><font color="#888888">Christopher Schmidt<br>
MetaCarta<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Signed,<br>Alessandro Ferrucci<br>