[OpenLayers-Users] WFS layer - commit works, save strategy from WFSProtocol does not work!!!! POST vs GET ?!?!

Ramón Boza rboza at sitep.com
Mon Mar 22 07:45:49 EDT 2010


I hope it helps you:

When I changed from WFS to Vector cause deprecation I got a full load of
problems, the exact and only working change that works for me is as follows:

var biblioteques = new OpenLayers.Layer.WFS(
                "biblioteques",
                "/geoserver/wfs",
                {typename: 'it:hm2_biblioteques'},
                {
                    typename: 'hm2_biblioteques',
                    featureNS: 'http://localhost:8080/it',
                    extractAttributes: false
                }
            );

To

biblioteques = new OpenLayers.Layer.Vector("biblioteques", {
            strategies: [new OpenLayers.Strategy.BBOX(), oSaveStrategy],
		projection: new OpenLayers.Projection("EPSG:23031"),
            protocol: new OpenLayers.Protocol.WFS({
		    version:	"1.1.0",
                url:           "/geoserver/wfs",
                featureType:   "dbb",
                srsName:       "EPSG:23031",
                geometryName:  "geom",
			featureNS:	"localhost:8080/it",
			featurePrefix:	"it",
                schema:
"http://randomSERVERIP:8080/wfs/DescribeFeatureType?version=1.1.0&typename=i
t:dbb"
            })
        });

Tips that worked for me:

* If in your geoserver the URI you defined is within localhost, use it,
don’t change it to the IP.


-----Mensaje original-----
De: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] En
nombre de paweluz
Enviado el: lunes, 22 de marzo de 2010 12:30
Para: users at openlayers.org
Asunto: Re: [OpenLayers-Users] WFS layer - commit works, save strategy from
WFSProtocol does not work!!!! POST vs GET ?!?!


Hi!


I have looke into the request in the two cases:
First when I use WFS layer and commit method. The request looks like this:

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" version="1.0.0"
service="WFS"><wfs:Insert><feature:probabaza 
xmlns:feature="http://www.openplans.org/topp">
<feature:the_geom>
<gml:MultiLineString xmlns:gml="http://www.opengis.net/gml">
<gml:lineStringMember>
<gml:LineString>
<gml:coordinates decimal="." cs="," ts=" ">1725436.9258124,6788640.0106605
1725967.2076961,6788807.2166599 
1726440.1618085,6788807.2166599</gml:coordinates></gml:LineString>
</gml:lineStringMember>
</gml:MultiLineString>
</feature:the_geom>
</feature:probabaza>
</wfs:Insert>
</wfs:Transaction>

When I use Vector Layer and the WFSProtocol the request looks like this:

<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS"
version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs 
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd http://www.openplans.org/topp
http://localhost:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typena
me=topp:probabaza"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wfs:Insert><feature:probabaza
xmlns:feature="http://www.openplans.org/topp">
<feature:the_geom>
<gml:LineString xmlns:gml="http://www.opengis.net/gml"
srsName="EPSG:4326"><gml:posList>15.543937683105 51.948074123254
15.536212921142 51.942148492442 
15.526084899903 51.939608696727
</gml:posList>
</gml:LineString>
</feature:the_geom>
</feature:probabaza>
</wfs:Insert>
</wfs:Transaction>

As you can see WFS layer uses MULTILINESTRING. WFSProtocol uses just
LINESTRING. All my geometry are multilinestrings in the database.
When I made an experiment by creating the new empty table I could add data
using WFSProtocol but data were added as LINESTRING! Why?? Now I can not use
my 

data that I have stored as MULTILINESTRING?? Is there a way to force
Openlayers to save data as MULTILINESTRING??

poul 
-- 
View this message in context:
http://n2.nabble.com/WFS-layer-commit-works-save-strategy-from-WFSProtocol-d
oes-not-work-POST-vs-GET-tp4777052p4777055.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users

Se certificó que el correo entrante no contiene virus.
Comprobada por AVG - www.avg.es 
Versión: 9.0.791 / Base de datos de virus: 271.1.1/2755 - Fecha de la
versión: 03/21/10 20:33:00





More information about the Users mailing list