<HTML><HEAD>
<META content="text/html; charset=iso-8859-15" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18828"></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Segoe UI">
<DIV>If you use Firefox and Firebug, you can watch the XML request go to / from the server.&nbsp; Chances are, it is returning an XML object not a text object.&nbsp; When this happens, responseText is empty and responseXML has your data.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Shawn<BR><BR>&gt;&gt;&gt; On 10/27/2009 at 2:18 PM, Alessandro Ferrucci &lt;alessandroferrucci@gmail.com&gt; wrote:<BR></DIV>
<DIV style="BORDER-LEFT: #050505 1px solid; BACKGROUND-COLOR: #f3f3f3; MARGIN: 0px 0px 0px 15px; PADDING-LEFT: 7px">Hello,<BR>I'm attempting to call getFeatureInfo from Openlayers to a geoserver instance.<BR><BR>Rigth now all I do is construct a GetFeatureInfo URL and supply that URL to 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">http://dialga.npc.census.gov:8080/geoserver/wms</A>";<BR><BR>map.events.register('click', map, function (e) {<BR>var url = wmsurl + "?REQUEST=GetFeatureInfo" + "&amp;EXCEPTIONS=application/vnd.ogc.se_xml"<BR>+ "&amp;BBOX=" + map.getExtent().toBBOX()<BR>+ "&amp;X=" + e.xy.x<BR>+ "&amp;Y=" + e.xy.y<BR>+ "&amp;INFO_FORMAT=text/html"<BR>+ "&amp;QUERY_LAYERS=cira:addresses"<BR>+ "&amp;LAYERS=cira:addresses"<BR>+ "&amp;FEATURE_COUNT=50"<BR>+ "&amp;SRS=EPSG:900913"<BR>+ "&amp;STYLES="<BR>+ "&amp;WIDTH=" + map.size.w<BR>+ "&amp;HEIGHT=" + map.size.h;<BR><BR>window.open(url, "getfeatureinfo", "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 request to the geoserver instance and get back the XMLHttpRequest obejct and 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">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>+ "&amp;EXCEPTIONS=application/vnd.ogc.se_xml"<BR>+ "&amp;BBOX=" + map.getExtent().toBBOX()<BR>+ "&amp;X=" + e.xy.x<BR>+ "&amp;Y=" + e.xy.y<BR>+ "&amp;INFO_FORMAT=text/html"<BR>+ "&amp;QUERY_LAYERS=cira:addresses"<BR>+ "&amp;LAYERS=cira:addresses"<BR>+ "&amp;FEATURE_COUNT=50"<BR>+ "&amp;SRS=EPSG:900913"<BR>+ "&amp;STYLES="<BR>+ "&amp;WIDTH=" + map.size.w<BR>+ "&amp;HEIGHT=" + map.size.h;<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>Thank you very much,<BR><BR clear=all><BR>-- <BR>Signed,<BR>Alessandro Ferrucci<BR></DIV></BODY></HTML>