Off the top of my head if you set the featureNS to the same namespace as the
workspace of the layer in geoserver it should work correctly (WFS.v1_1_0),
e.g. in geoserver we have a workspace called *ge* and a namespace of *
http://ge*, openlayers settings are like follows
featurePrefix: "ge",
featureNS: "http://ge",
featureType: "Bar"
More info here
http://dev.openlayers.org/releases/OpenLayers-2.10/doc/apidocs/files/OpenLayers/Protocol/WFS/v1_1_0-js.html
I think WFS v1_0_0 lets you get away without a namespace (i.e. just set a
featureType to "foo:Bar" others not required), but 1.1.0 needs a namespace
to correctly filter responses.
Cheers,
Adon
On 4 April 2011 22:43, Sunny Teo <spatialsu...@gmail.com> wrote:
> Hi All,
>
> I am trying to build geospatial application using OpenLayers and
> Geoserver 2.1-RC3. Implementing WFS part I've faced with the following
> problem:
>
> OpenLayers builds such request:
>
> <wfs:GetFeature
> service="WFS"
> version="1.1.0"
> xsi:schemaLocation="http://www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
> <wfs:Query typeName="foo:Bar" srsName="EPSG:96995">
> <ogc:Filter>
> <ogc:BBOX>
> <ogc:PropertyName>GEOM</ogc:PropertyName>
> <gml:Envelope srsName="EPSG:96995">
> <gml:lowerCorner>-49003.957598278
> -32778.430510464</gml:lowerCorner>
> <gml:upperCorner>49003.957598278 25546.430510464</gml:upperCorner>
> </gml:Envelope>
> </ogc:BBOX>
> </ogc:Filter>
> </wfs:Query>
> </wfs:GetFeature>
>
> In response on this request my Geoserver response with such exception:
>
> <ows:ExceptionReport version="1.0.0"
> xsi:schemaLocation="http://www.opengis.net/ows
> http://services.local:80/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd<http://services.local/geoserver/schemas/ows/1.0.0/owsExceptionReport.xsd>
> ">
> <ows:Exception exceptionCode="NoApplicableCode">
> <ows:ExceptionText>
> org.xmlpull.v1.XmlPullParserException: could not determine
> namespace bound to element prefix wfs (position: START_DOCUMENT seen
> ...www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">.<http://schemas.opengis.net/wfs/1.1.0/wfs.xsd%22%3E.>..
> @1:139)
> could not determine namespace bound to element prefix wfs
> (position: START_DOCUMENT seen ...www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">.<http://schemas.opengis.net/wfs/1.1.0/wfs.xsd%22%3E.>..
> @1:139)
> </ows:ExceptionText>
> </ows:Exception>
> </ows:ExceptionReport>
>
> I have reproduced this request manually. If I add the following
> attributes to the wfs:GetFeature element
>
> xmlns:wfs="http://www.opengis.net/wfs"
> xmlns:ogc="http://www.opengis.net/ogc"
> xmlns:gml="http://www.opengis.net/gml"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>
> Server produces correct answer (spatial data). I get these attributes
> from Geoserver demo request.
>
> Looks like server performs some kind of XML validation and decides
> that request is not well formed.
>
> I've tried to disable "Strict CITE compliance". Tried to test with
> both options for "Encode canonical WFS schema location" but no
> positive result.
>
> I've compared this OpenLayers request with requests prepared by
> OpenLayer on the few public websites - the same situation. There is no
> bindings for
> wfs, ogc, gml, xsi prefixes.
>
> So, I assume there should be approach to disable this validation or to
> get Geoserver parser to know about such common prefixes.
>
> Maybe I have missed something. Help me please.
>
>
> Thanks,
>
> Sunny
>
>
> ------------------------------------------------------------------------------
> Create and publish websites with WebMatrix
> Use the most popular FREE web apps or write code yourself;
> WebMatrix provides all the features you need to develop and
> publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
>
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
>
--
Adon Metcalfe
Labyrinth Data Services Pty Ltd
http://www.labyrinthdata.net.au
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users