[TinyOWS-users] [OpenLayers-Users] Problems implementing WFS

Maxime Phaneuf maxime.phaneuf at usherbrooke.ca
Wed Jul 29 09:17:18 EST 2009


Thank you Alexandre for this quick answer.

As you suggested, I'm moving this discussion in the TinyOWS mailing list.
I'll see what this workaround is and try to make the INSERT work.

By the way, TinyOWS has been fairly simple to configure and has answered our
needs. We're pretty satisfied thus far.

Maxime Phaneuf

Selon Alexandre Dube <adube at mapgears.com>:

> Hi,
>
> See below.
>
> Maxime Phaneuf wrote:
> > I've compared this to the GML Insert you send to TinyOWS in
> > http://dev4.mapgears.com/bdga/bdgaWFS-T.html and it looks alike.
> >
> > This is the answer I received from TinyOWS:
> > <?xml version='1.0' encoding='UTF-8'?>
> > <ows:ExceptionReport
> >  xmlns='http://www.opengis.net/ows'
> >  xmlns:ows='http://www.opengis.net/ows'
> >  xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
> >  xsi:schemaLocation='http://www.opengis.net/ows
> > http://schemas.opengis.net/ows/1.0.0/owsExceptionReport.xsd'
> >  version='1.1.0' language='en'>
> >  <ows:Exception exceptionCode='InvalidParameterValue' locator='request'>
> >   <ows:ExceptionText>xml isn't valid</ows:ExceptionText>
> >  </ows:Exception>
> > </ows:ExceptionReport>
> >
> > Since the update works, I suppose the saveStrategy is not the problem. Do
> > you know what could be the problem?
> >
> >
>
> This looks like a TinyOWS problem.  It uses the very strict libxml2
> library to validate the received xml.  I don't know what's the status of
> this problem, but there's a workaround.  Maybe we could continue this
> discussion on TinyOWS-users ML if you don't mind.
>
> What version of TinyOWS are you using ?  On which platform ?
>
> I think your problem is related to the following ticket :
> http://www.tinyows.org/trac/tinyows/ticket/22
>
> Regards,
>
> Alexandre
>
> > Thanks,
> > Maxime
> >
> >
> >
> > Alexandre Dube wrote:
> >
> >> Hi,
> >>
> >>   Yes, this looks like a namespace problem.  With firebug, go to the
> >> lib/OpenLayers/Format/XML.js file, in the readNode function at line :
> >>
> >> var group = this.readers[this.namespaceAlias[node.namespaceURI]];
> >>
> >> and put a breakpoint there.  You'll understand what's going on and also
> >> what namespace you need to define.
> >>
> >> Hope this helps,
> >>
> >> Alexandre
> >>
> >> Maxime Phaneuf wrote:
> >>
> >>> Hi guys
> >>>
> >>> I've got the same problem as Hugo. My WFS layer would not appear on the
> >>> map,
> >>> even though I've got a ok server response.
> >>>
> >>> My layer looks like this:
> >>>      wfs = new OpenLayers.Layer.Vector("France", {
> >>>                 strategies: [new OpenLayers.Strategy.BBOX(),
> >>> saveStrategy],
> >>>                 protocol: new OpenLayers.Protocol.WFS({
> >>> 					version:       "1.0.0",
> >>> 					url:           "http://mydomain/cgi-bin/tinyows",
> >>> 					featureType:   "france_dept",
> >>> 					srsName:       "EPSG:24582",
> >>> 					featurePrefix: "tows",
> >>> 					//featureNS:     "http://mydomain",
> >>> 					geometryName:  "the_geom",
> >>> 					schema:
> >>>
>
"http://mydomain/cgi-bin/tinyows?service=WFS&version=1.0.0&request=DescribeFeatureType&TypeName=france_dept",
> >>> 				})
> >>>             });
> >>>
> >>> Define like this, the layer will show up, but any modification can't be
> >>> saved. When I take off the comments of featureNS, it will not show up, so
> >>> I
> >>> suppose it is an error caused by the namespace.
> >>>
> >>> I've tried putting a breakline where you told but it doesn't even stop
> >>> when
> >>> I reload the page.
> >>> What is the correct value to put for featureNS? Or do you see anything
> >>> else
> >>> wrong with my layer definition?
> >>>
> >>> Thank you
> >>> Maxime Phaneuf
> >>>
> >>>
> >>> Hugo-2 wrote:
> >>>
> >>>
> >>>> Hi Alexandre,
> >>>>
> >>>> Thanks for your help. Indeed it was a problem with the namespace. A
> >>>> dummy
> >>>> mistake :)
> >>>>
> >>>> Kind regards,
> >>>>
> >>>> Hugo Martins
> >>>>
> >>>> On Tue, Jun 30, 2009 at 1:00 PM, Alexandre Dube <adube at mapgears.com>
> >>>> wrote:
> >>>>
> >>>>
> >>>>
> >>>>> Hi Hugo,
> >>>>>
> >>>>>  This looks like a feature namespace problem.  See the Format.XML
> >>>>> readNode
> >>>>> function, put a break point at line :
> >>>>>
> >>>>> var group = this.readers[this.namespaceAlias[node.namespaceURI]];
> >>>>>
> >>>>>  This might be the problem,
> >>>>>
> >>>>> Alexandre
> >>>>>
> >>>>> Hugo wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>> Hello all,
> >>>>>>
> >>>>>> I'm having troubles to implement a vector layer with WFS protocol.
> >>>>>> From
> >>>>>> firebug i can see that the attributes from the layer are extracted,
> >>>>>> however
> >>>>>> no vector feature is displayed in the map.
> >>>>>> DO you have any suggestions??? My code is as follows:
> >>>>>>
> >>>>>> var saveStrategy = new OpenLayers.Strategy.Save();
> >>>>>>        var wfs2 = new OpenLayers.Layer.Vector(
> >>>>>>            "ExplorWFS2",
> >>>>>>            {
> >>>>>>                strategies: [new OpenLayers.Strategy.BBOX(),
> >>>>>> saveStrategy],
> >>>>>>                projection: wgs,
> >>>>>>                protocol: new OpenLayers.Protocol.WFS({
> >>>>>>                    version: "1.1.0",
> >>>>>>                    srsName: "EPSG:4326",
> >>>>>>                    url: "http://isegi.dyndns.org:8080/geoserver/wfs?",
> >>>>>>                    featureNS :  "http://isegi.dyndns.org:8080/sigla",
> >>>>>>                    featureType: "explor",
> >>>>>>                    geometryName: "the_geom",
> >>>>>>                    schema: "
> >>>>>>
>
http://isegi.dyndns.org:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=sigla:explor<
> >>>>>>
>
http://isegi.dyndns.org:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=sigla:explor
> >>>>>>
> >>>>>>
> >>>>>>> ",
> >>>>>>>
> >>>>>>>
> >>>>>>                    format: new OpenLayers.Format.WFST.v1_1_0({
> >>>>>>                        featureType: 'explor',
> >>>>>>                        featureNS:
> >>>>>> "http://isegi.dyndns.org:8080/sigla",
> >>>>>>                        featurePrefix: 'sigla',
> >>>>>>                        geometryName: 'the_geom'
> >>>>>>                    })
> >>>>>>                })              }
> >>>>>>        );
> >>>>>>
> >>>>>> I have tried these code with and without the format option.
> >>>>>>
> >>>>>> If i simply use the following code, everything goes perfect and vector
> >>>>>> features are displayed in the map:
> >>>>>>
> >>>>>> var wfs = new OpenLayers.Layer.WFS(
> >>>>>>            "ExplorWFS",
> >>>>>>            "http://isegi.dyndns.org:8080/geoserver/wfs?",
> >>>>>>            {typename: 'sigla:explor'},
> >>>>>>            {
> >>>>>>                featureVersion: "1.0.0",
> >>>>>>                typename: 'explor',
> >>>>>>                featureNS: '"http://isegi.dyndns.org:8080/sigla',
> >>>>>>                geometryName: "the_geom",
> >>>>>>                projection: wgs,
> >>>>>>                extractAttributes: true,
> >>>>>>                schema: "
> >>>>>>
>
http://isegi.dyndns.org:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=sigla:explor<
> >>>>>>
>
http://isegi.dyndns.org:8080/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=sigla:explor
> >>>>>>
> >>>>>>
> >>>>>>> "
> >>>>>>>
> >>>>>>>
> >>>>>>            }
> >>>>>>        );
> >>>>>>
> >>>>>> Thanks in advance.
> >>>>>> Kind regards,
> >>>>>>
> >>>>>> Hugo Martins
> >>>>>>
> ------------------------------------------------------------------------
> >>>>>>
> >>>>>> _______________________________________________
> >>>>>> Users mailing list
> >>>>>> Users at openlayers.org
> >>>>>> http://openlayers.org/mailman/listinfo/users
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>> --
> >>>>> Alexandre Dubé
> >>>>> Mapgears
> >>>>> www.mapgears.com
> >>>>>
> >>>>>
> >>>>>
> >>>>>
> >>>> _______________________________________________
> >>>> Users mailing list
> >>>> Users at openlayers.org
> >>>> http://openlayers.org/mailman/listinfo/users
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >> --
> >> Alexandre Dubé
> >> Mapgears
> >> www.mapgears.com
> >>
> >> _______________________________________________
> >> Users mailing list
> >> Users at openlayers.org
> >> http://openlayers.org/mailman/listinfo/users
> >>
> >>
> >>
> >
> >
>
>
> --
> Alexandre Dubé
> Mapgears
> www.mapgears.com
>
>
>


-- 
Maxime Phaneuf
Candidat à la maîtrise en géomatique
Université de Sherbrooke


More information about the TinyOWS-users mailing list