Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got a TinyOWS on localhost that works fine (both through browser GetFeature and QGIS). But my OpenLayers code fails. I've checked here: Display a WFS layer with OpenLayers and here : How to add a simple WFS layer from GeoServer to OpenLayers map? and other similar questions to no avail. Can anyone help?

Here is the code:

    wfs = new OpenLayers.Layer.Vector("Editable Features", {
    strategies : [new OpenLayers.Strategy.Fixed(), saveStrategy],
    projection: new OpenLayers.Projection("EPSG:4326"),
    protocol: new OpenLayers.Protocol.WFS({
        version: "1.1.0",
        srsName: "EPSG:4326",
        url: "http://localhost/cgi-bin/tinyows",
        featurePrefix: "tows",
        featureNS :  "",
        featureType: "trad",
        geometryName: "wkb_geometry",
        schema: ""

map.addLayers([gphy, wfs]);

Here is the xml according to Firebug:

<wfs:GetFeature xmlns:wfs="" service="WFS" version="1.1.0" xsi:schemaLocation="" xmlns:xsi="">

Here is the post response according to firebug:

<?xml version='1.0' encoding='UTF-8'?>
  version='1.1.0' language='en'>
<ows:Exception exceptionCode='InvalidParameterValue' locator='request'>
<ows:ExceptionText>XML request isn't valid</ows:ExceptionText>

Here is the TinyOWS config file:

<tinyows online_resource=""
<pg host="" user="postgres" password="****" dbname="****" port="5432"/>
<metadata name="TinyOWS Server"
       title="TinyOWS Server - Demo Service" />
<layer retrievable="1"
    title="Träd" />
share|improve this question

In your TinyOWS config you write online_resource="" but in OpenLayers you use another host name - http://localhost/cgi-bin/tinyows. This mismatch causes an error.

share|improve this answer
tried that - made no difference. – user10895 Mar 11 '13 at 6:52
Try to move schema option from WFS protocol config. – drnextgis Mar 11 '13 at 8:08
Ok, can you clarify - are you talking about the tinyows config file or the javascript? – user10895 Mar 11 '13 at 8:41
OpenLayers javascript – drnextgis Mar 11 '13 at 11:07
Ok, thanks, do you mean REMOVE or change the schema? If change, what to? – user10895 Mar 11 '13 at 11:44

Oops - turns out I had the wrong schema_dir in tinyows.xml. I changed /usr/local/tinyows/schema/ to /usr/share/tinyows/schema and now it's loading fine. Maybe someone could update the config file example on ?

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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