Take the 2-minute tour ×

I'm using GeoExt, OpenLayers and GeoServer. I've added a checkbox to my layer tree which, when clicked, activates a "select feature" control such that when a user clicks on the map, the feature clicked on is highlighted. My code is:

'checkchange': function(node, checked) { 
                if (checked === true) {
                    mySelectLayer = new OpenLayers.Layer.Vector("Selection", {
                        styleMap: new OpenLayers.Style(OpenLayers.Feature.Vector.style["select"])

                    myLayerCtrl = new OpenLayers.Control.GetFeature({
                        protocol: OpenLayers.Protocol.WFS.fromWMSLayer(node.attributes.layer),
                        box: true,
                        multipleKey: "shiftKey",
                        toggleKey: "ctrlKey"
                    myLayerCtrl.events.register("featureselected", this, function(e){

                } else {

However, when a user clicks on the map the following exception is thrown by GeoServer:

org.geoserver.platform.ServiceException: No such operation WMS 1.1.0 GetFeature

I've found a number of posts on this, but no solutions. Any idea about what is causing this problem? Thanks in advance.

UPDATE: I've read that this error is as a result of the request being sent to WMS, as opposed to WFS service. My assumption, however, is that it should be possible for OpenLayers to deduce the WFS service. From the OpenLayers documentation here, the protocol parameter kind of takes care of ensuring WFS, and not WMS, is used, in my opinion. Any idea is welcome.

share|improve this question

1 Answer 1

You are using a wrong url in your protocol; the function


doesn't change the url to the geoserver's wfs service (OpenLayers doesn't know that there is Geoserver), which is /wfs. Try to do something like

var protocol = OpenLayers.Protocol.WFS.fromWMSLayer(node.attributes.layer);
protocol.url = '/wfs';   // Add your geoserver base url
share|improve this answer

Your Answer


