Hi,<div><br></div><div>I'm trying to use GWT-OpenLayers to carry out some simple WFS requests. However, I'm having some trouble with OpenLayers not displaying my data.</div><div><br></div><div>I'm using GeoServer as my WFS, which names its layers like "sf:roads", where "sf" is the namespace. This first example, where I specify the namespace URL, works fine:</div>
<div><br></div><div>### JAVA CODE ###</div><div><br></div><div><div>WFSProtocolOptions wfsProtocolOptions = new WFSProtocolOptions();</div><div>wfsProtocolOptions.setUrl("<a href="http://li199-25.members.linode.com:8080/geoserver/wfs">http://li199-25.members.linode.com:8080/geoserver/wfs</a>");</div>
<div>wfsProtocolOptions.setFeatureType("roads");</div><div>wfsProtocolOptions.setFeatureNameSpace("<a href="http://www.openplans.org/spearfish">http://www.openplans.org/spearfish</a>");</div><div>wfsProtocolOptions.setSrsName("EPSG:4326");</div>
<div>wfsProtocolOptions.setVersion("1.1.0");</div></div><div><br></div><div>This results in OpenLayers making the following XML request, which leads to a valid response which is displayed correctly:</div><div><br>
</div><div>### XML GetFeature REQUEST ###</div><div><br></div><div><div class="nodeBox open "><div class="nodeLabel "><span class="nodeLabelBox repTarget "><<span class="nodeTag ">wfs:GetFeature</span><span class="nodeAttr editGroup "> <span class="nodeName editable ">xmlns:wfs</span>="<span class="nodeValue editable "><a href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a></span>"</span><span class="nodeAttr editGroup "> <span class="nodeName editable ">service</span>="<span class="nodeValue editable ">WFS</span>"</span><span class="nodeAttr editGroup "> <span class="nodeName editable ">version</span>="<span class="nodeValue editable ">1.1.0</span>"</span><span class="nodeAttr editGroup "> <span class="nodeName editable ">xsi:schemaLocation</span>="<span class="nodeValue editable "><a href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a> <a href="http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">http://schemas.opengis.net/wfs/1.1.0/wfs.xsd</a></span>"</span><span class="nodeAttr editGroup "> <span class="nodeName editable ">xmlns:xsi</span>="<span class="nodeValue editable "><a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a></span>"</span><span class="nodeBracket ">></span></span></div>
<div class="nodeChildBox "><div class="nodeBox textNodeBox "><div class="nodeLabel "><span class="nodeLabelBox repTarget "><<span class="nodeTag ">wfs:Query</span><span class="nodeAttr editGroup "> <span class="nodeName editable ">typeName</span>="<span class="nodeValue editable ">feature:roads</span>"</span><span class="nodeAttr editGroup "> <span class="nodeName editable ">srsName</span>="<span class="nodeValue editable ">EPSG:4326</span>"</span><span class="nodeAttr editGroup "> <span class="nodeName editable ">xmlns:feature</span>="<span class="nodeValue editable "><a href="http://www.openplans.org/spearfish">http://www.openplans.org/spearfish</a></span>"</span><span class="nodeBracket editable insertBefore ">></span><span class="nodeText editable "></span></<span class="nodeTag ">wfs:Query</span>></span></div>
</div></div><div class="nodeCloseLabel "></<span class="nodeTag ">wfs:GetFeature</span>></div><div class="nodeCloseLabel "><br></div><div class="nodeCloseLabel ">However, this next example does not work. Here, I'm only specifying the full layer title "sf:road" and not specifying the namespace.</div>
<div class="nodeCloseLabel "><br></div><div class="nodeCloseLabel ">### JAVA CODE ###</div><div class="nodeCloseLabel "><br></div><div class="nodeCloseLabel "><div>WFSProtocolOptions wfsProtocolOptions = new WFSProtocolOptions();</div>
<div>wfsProtocolOptions.setUrl("<a href="http://li199-25.members.linode.com:8080/geoserver/wfs">http://li199-25.members.linode.com:8080/geoserver/wfs</a>");</div><div>wfsProtocolOptions.setFeatureType("sf:roads");</div>
<div>wfsProtocolOptions.setSrsName("EPSG:4326");</div><div>wfsProtocolOptions.setVersion("1.1.0");</div><div><br></div><div>This results in the following XML request being sent. GeoServer handles this request fine and returns a valid FeatureCollection (as far as I can tell, it's exactly the same as the previous example). However, for some reason OpenLayers just won't display it!</div>
<div><br></div><div>### XML GetFeature REQUEST ###</div><div><br></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><wfs:GetFeature xmlns:wfs="<a href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a>" service="WFS" version="1.1.0" xsi:schemaLocation="<a href="http://www.opengis.net/wfs">http://www.opengis.net/wfs</a> <a href="http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">http://schemas.opengis.net/wfs/1.1.0/wfs.xsd</a>" xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"><wfs:Query typeName="sf:streams" srsName="EPSG:4326"/></wfs:GetFeature></span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Does anyone have any idea why OpenLayers won't display the results of this kind of request?</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Thanks,</span></div>
<div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></span></div><div><span class="Apple-style-span" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">Jon</span></div>
</div></div></div>