Hi Ian,<div><br></div><div>In both cases GeoServer processes the request fine (both Firebug and the GeoServer logs show this).  Both requests return the same result, in fact (you can test it using the GeoServer test page).  GeoServer actually uses the &quot;sf&quot; part of the layer name to find the correct namespace URL. My second example produces the following in the GeoServer logs:</div>

<div><br></div><div><div>Request: getFeature</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>handle = null</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>service = WFS</div>
<div>
<span class="Apple-tab-span" style="white-space:pre">        </span>version = 1.1.0</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>baseUrl = <a href="http://li199-25.members.linode.com:8080/geoserver/">http://li199-25.members.linode.com:8080/geoserver/</a></div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>providedVersion = null</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>extendedProperties = {}</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>query = [net.opengis.wfs.impl.QueryTypeImpl@1953684 (group: null, propertyName: null, function: null, filter: null, sortBy: null, featureVersion: null, handle: null, srsName: EPSG:4326, typeName: [{<a href="http://www.openplans.org/spearfish}streams]">http://www.openplans.org/spearfish}streams]</a>)]</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>maxFeatures = null</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>outputFormat = text/xml; subtype=gml/3.1.1</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>resultType = results</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>traverseXlinkDepth = null</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>traverseXlinkExpiry = null</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>formatOptions = {}</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>metadata = null</div><div><br></div><div>As you can see, the typename is [{<a href="http://www.openplans.org/spearfish}streams])">http://www.openplans.org/spearfish}streams])</a>].  Again, GeoServer seems to be handling the request fine so I&#39;m a bit confused as to why it&#39;s not showing in OpenLayers...</div>

<div><br></div><div>Cheers,</div><div><br></div><div>Jon</div><br><div class="gmail_quote">On 8 June 2011 15:44, Ian Turton <span dir="ltr">&lt;<a href="mailto:ijturton@gmail.com">ijturton@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On 8 June 2011 06:26, Jon Britton &lt;<a href="mailto:jonbritton3@googlemail.com">jonbritton3@googlemail.com</a>&gt; wrote:<br>


&gt; Hi,<br>
&gt; I&#39;m trying to use GWT-OpenLayers to carry out some simple WFS requests.<br>
&gt; However, I&#39;m having some trouble with OpenLayers not displaying my data.<br>
&gt; I&#39;m using GeoServer as my WFS, which names its layers like &quot;sf:roads&quot;, where<br>
&gt; &quot;sf&quot; is the namespace.  This first example, where I specify the namespace<br>
&gt; URL, works fine:<br>
&gt; ### JAVA CODE ###<br>
&gt; WFSProtocolOptions wfsProtocolOptions = new WFSProtocolOptions();<br>
&gt; wfsProtocolOptions.setUrl(&quot;<a href="http://li199-25.members.linode.com:8080/geoserver/wfs" target="_blank">http://li199-25.members.linode.com:8080/geoserver/wfs</a>&quot;);<br>
&gt; wfsProtocolOptions.setFeatureType(&quot;roads&quot;);<br>
&gt; wfsProtocolOptions.setFeatureNameSpace(&quot;<a href="http://www.openplans.org/spearfish" target="_blank">http://www.openplans.org/spearfish</a>&quot;);<br>
&gt; wfsProtocolOptions.setSrsName(&quot;EPSG:4326&quot;);<br>
&gt; wfsProtocolOptions.setVersion(&quot;1.1.0&quot;);<br>
&gt; This results in OpenLayers making the following XML request, which leads to<br>
&gt; a valid response which is displayed correctly:<br>
&gt; ### XML GetFeature REQUEST ###<br>
&gt; &lt;wfs:GetFeature xmlns:wfs=&quot;<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a>&quot; service=&quot;WFS&quot; version=&quot;1.1.0&quot; xsi:schemaLocation=&quot;<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a><br>


&gt; <a href="http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" target="_blank">http://schemas.opengis.net/wfs/1.1.0/wfs.xsd</a>&quot; xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&quot;&gt;<br>


&gt; &lt;wfs:Query typeName=&quot;feature:roads&quot; srsName=&quot;EPSG:4326&quot; xmlns:feature=&quot;<a href="http://www.openplans.org/spearfish" target="_blank">http://www.openplans.org/spearfish</a>&quot;&gt;&lt;/wfs:Query&gt;<br>


&gt; &lt;/wfs:GetFeature&gt;<br>
&gt; However, this next example does not work. Here, I&#39;m only specifying the full<br>
&gt; layer title &quot;sf:road&quot; and not specifying the namespace.<br>
&gt; ### JAVA CODE ###<br>
&gt; WFSProtocolOptions wfsProtocolOptions = new WFSProtocolOptions();<br>
&gt; wfsProtocolOptions.setUrl(&quot;<a href="http://li199-25.members.linode.com:8080/geoserver/wfs" target="_blank">http://li199-25.members.linode.com:8080/geoserver/wfs</a>&quot;);<br>
&gt; wfsProtocolOptions.setFeatureType(&quot;sf:roads&quot;);<br>
&gt; wfsProtocolOptions.setSrsName(&quot;EPSG:4326&quot;);<br>
&gt; wfsProtocolOptions.setVersion(&quot;1.1.0&quot;);<br>
&gt; This results in the following XML request being sent. GeoServer handles this<br>
&gt; request fine and returns a valid FeatureCollection (as far as I can tell,<br>
&gt; it&#39;s exactly the same as the previous example).  However, for some reason<br>
&gt; OpenLayers just won&#39;t display it!<br>
&gt; ### XML GetFeature REQUEST ###<br>
&gt; &lt;wfs:GetFeature xmlns:wfs=&quot;<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a>&quot; service=&quot;WFS&quot;<br>
&gt; version=&quot;1.1.0&quot;<br>
&gt; xsi:schemaLocation=&quot;<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a> <a href="http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" target="_blank">http://schemas.opengis.net/wfs/1.1.0/wfs.xsd</a>&quot;<br>


&gt; xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>&quot;&gt;&lt;wfs:Query<br>
&gt; typeName=&quot;sf:streams&quot; srsName=&quot;EPSG:4326&quot;/&gt;&lt;/wfs:GetFeature&gt;<br>
&gt; Does anyone have any idea why OpenLayers won&#39;t display the results of this<br>
&gt; kind of request?<br>
<br>
</div></div>It is GeoServer that is refusing to handle the second request not<br>
OpenLayers (check the log file or firebug) - in the second case you<br>
have a namespace (sf) that GeoServer can&#39;t process since you haven&#39;t<br>
defined it. If you look at the first request you&#39;ll see<br>
xmlns:feature=&quot;<a href="http://www.openplans.org/spearfish" target="_blank">http://www.openplans.org/spearfish</a>&quot; which is what<br>
GeoServer uses to work out which roads features you want.<br>
<br>
Ian<br>
<font color="#888888">--<br>
Ian Turton<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a><br>
</font></blockquote></div><br></div>