<P>I see. Can you elaborate just a little? I have seen this frequently (i.e., the vector being created from "featureType" and "featureNS"); but no good explanations for how to use it.</P>
<P>As a newbie, the OpenLayers documentation is often ambiguous, at best. As with this example, a lot of things are documented for an experienced reader (as a reference) and not for a newbie (like me).</P>
<P>Let us say that I have the following:</P>
<PRE>
<BLOCKQUOTE>
------------------------------------------------------------
- map/workspace:
------------------------------------------------------------
Name: MyMap
workspace namespace URI: http://localhost:8081/MyMap
------------------------------------------------------------
- stores (vector data sources):
------------------------------------------------------------
DataSourceName: MyLayer
URL: file:data/MyMap/MyLayer.shp
------------------------------------------------------------
- layers:
------------------------------------------------------------
Name: MyLayer
</BLOCKQUOTE>
</PRE>
<P>What would this WFS query look like? I tried the following (but it did not work):</P>
<PRE>
<BLOCKQUOTE>
var wfs = new OpenLayers.Layer.Vector( "MyFeatures", {
strategies: [new OpenLayers.Strategy.BBOX()],
protocol: new OpenLayers.Protocol.WFS({
url: "http://localhost:8081//geoserver/wfs",
featureType: "MyLayer",
featureNS: "http://localhost:8081/MyMap"
})
});
var features = wfs.features;
alert( features.length );
</BLOCKQUOTE>
</PRE>
<P>The features always returns 0 length. I have tried some different permutations; but, I am not sure what the "featureNS" (feature namespace) is supposed to be. I mean, the workspace namespace is not right. Am I to assume it is supposed to be some URL for the store? If so, what might that be? Also, I don't know what the "featureType" is.</P>
<P>The definitions for each (in the API doc) are as follows:</P>
<h3 class="CTitle"><a name="OpenLayers.Format.GML.Base.featureType" target="_top" rel="nofollow" link="external"></a>featureType</h3><div class="CBody"><p>{Array(String) or String} The local (without prefix) feature typeName(s).</p></div></div></div>
<div class="CProperty"><div class="CTopic"><h3 class="CTitle"><a name="OpenLayers.Format.GML.Base.featureNS" target="_top" rel="nofollow" link="external"></a>featureNS</h3><div class="CBody"><p>{String} The feature namespace. Must be set in the options at construction.</p>
<P>But neither are specific/explicit enough for me to figure it out and I have not seen a documented example of this that allows me to glean the necessary details.</P>
<P>Is there something that I am supposed to do for a WMS layer that I am not seeing? I am using GeoServer; but there is not a WMS versus WFS configuration for these shapefiles. At least, I have not found anything. My problem lies with my ignorance on how to call WFS.</P>
<P>Thanks again for your help and prompt response.</P>
        <div class="signature">Up the Irons!!!</div>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/Get-Features-from-a-WMS-Layer-tp6396039p6396948.html">Re: Get Features from a WMS Layer</a><br/>
Sent from the <a href="http://osgeo-org.1803224.n2.nabble.com/OpenLayers-Users-f1822463.html">OpenLayers Users mailing list archive</a> at Nabble.com.<br/>