Hello list,
I am trying to save features to a PostGIS DB using tinyows. Saving geometries alone works fine, updating records works well, but as soon as I combine attributes and geometries, I get an error from tinyows indicating that the XML is not in the right format. I have noticed a difference between the 3 scenarios. For instance, when I save a geometry without attributes, I get the following: (this works fine)
<wfs:Insert>
    <feature:parcels xmlns:feature="http://www.tinyows.org/">
    <feature:geom>
        <gml:MultiSurface xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:3857">
        <gml:surfaceMember>
            <gml:Polygon>
                <gml:exterior>
                    <gml:LinearRing>
                        <gml:posList>-10752.....</gml:posList>
                    </gml:LinearRing>
                </gml:exterior>
            </gml:Polygon>
        </gml:surfaceMember>
    </gml:MultiSurface>
</feature:geom>
</feature:washco_parcels>
</wfs:Insert>


And, when I add attributes, I get the following: (generates an error to teh effect that "<feature:address1>test" is unexpected)

<wfs:Insert>
    <feature:parcels xmlns:feature="http://www.tinyows.org/">
    <feature:geom>
        <gml:MultiSurface xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:3857">
        <gml:surfaceMember>
            <gml:Polygon>
                <gml:exterior>
                    <gml:LinearRing>
                        <gml:posList>-10752.....</gml:posList>
                    </gml:LinearRing>
                </gml:exterior>
            </gml:Polygon>
        </gml:surfaceMember>
    </gml:MultiSurface>
</feature:geom>
<feature:address1>test</feature:address1>
</feature:washco_parcels>
</wfs:Insert>

Finally, if I do a simple UPDATE, I get the following: (works fine)
<wfs:Update xmlns:demo="http://www.tinyows.org/" typeName="demo:parcels">
<wfs:Property>
    <wfs:Name>geom</wfs:Name>
    <wfs:Value>
        <gml:MultiSurface xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:3857">
        <gml:surfaceMember>
            <gml:Polygon>
                <gml:exterior>
                    <gml:LinearRing>
                        <gml:posList>-10737.....</gml:posList>
                    </gml:LinearRing>
                </gml:exterior>
            </gml:Polygon>
        </gml:surfaceMember>
    </gml:MultiSurface>
</wfs:Value>
</wfs:Property>
<wfs:Property>
    <wfs:Name>objectid</wfs:Name>
    <wfs:Value>18785</wfs:Value>
</wfs:Property>
.......

The first difference is in the namespace used (feature vs wfs). Any reason why it is doing so? Another difference is in the way attributes are included:
<wfs:Property>
    <wfs:Name>objectid</wfs:Name>
    <wfs:Value>18785</wfs:Value>
</wfs:Property>
vs
<feature:address1>test</feature:address1>
The third example (using wfs:Property) seems to be the correct way to specify information in a WFS file. The first example works fine despite not using that format, because I suspect the GML schema is more flexible and since it does not have attributes that are not geometries, it is considered valid.

So I tried turning off schema checking in the tinyows.xml file and the problem payload go through without issues. So this seem to indicate that some of the XSD used are strict and don't allow attributes to be defined like <feature:address1>test</feature:address1>.

So my question is how do I fix this best?
  1. remove schema enforcing at the tinyows level. Couldn't this lead to potential security issues with the server?
  2. Change the XSD files to allow both ways to define attributes. Wouldn't this go against the WFS standard?
  3. Change the way OL generates the payload. Not sure where it does it or how to force it to use a different one.

BTW, I am using OL 2.12 and Tinyows 1.0.0
thanks!
Eric




_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to