Can you help me with WFS on GeoExt? I'm read tutorial and see this code.

proxy: new GeoExt.data.ProtocolProxy({
        protocol: new OpenLayers.Protocol.WFS({
            url: "/geoserver/ows",
            version: "1.1.0",
            featureType: "parks",
            featureNS: "http://medford.opengeo.org",
            srsName: "EPSG:4326"

After this I see this var vectorLayer = new OpenLayers.Layer.Vector("Editable features"); And don't understand how to create a layer. So I have some questions.

  1. How to get URL for the WFS? (I use GeoServer)
  2. What does it mean by featureType option.
  3. And more important. This code is correct? I find it here http://workshops.opengeo.org/geoext/wfs/grid.html

2 Answers 2


I think you would benefit from splitting your problem into GeoExt and OpenLayers.

Start with the OpenLayers examples (http://openlayers.org/dev/examples/), looking at each WFS example to see how it is done. Here is a really simple example http://openlayers.org/dev/examples/wfs-states.html - zoom in a bit if you don't see the white states outlines. Now look at the code for that (http://openlayers.org/dev/examples/wfs-states.js). Now work through the other WFS examples.

featureType is the name of the "layer" on the WFS server.

Edits: http://trac.osgeo.org/openlayers/wiki/FrequentlyAskedQuestions#ProxyHost described why you might need a ProxyHost, and how to set it up.

The namespace qualifies the featureType, so a server can offer more than one WFS layer with the same name (e.g. "tanks" could mean something different in a military sense and in a water sense).

  • Thank u. I see this example. But i dont know wnat is it OpenLayers.ProxyHost = "proxy.cgi?url=";. Can u say me? And featureNS thi is name of the workspace?
    – Kliver Max
    Commented Jul 12, 2012 at 5:28
  • Try do like in this example but dont see a layer. In firebug i see answer from geoserver with layer but on map is nothing.
    – Kliver Max
    Commented Jul 12, 2012 at 5:53

You should check this answer, regarding your confusions in the original question. And regarding OpenLayers.ProxyHost, you can check this link. There are several other related questions here, you can read through them to have a better understanding.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.