[OpenLayers-Users] Namespaces in the WFS POST requests

Serge Markin serge.n.markin at gmail.com
Mon Apr 4 05:34:41 EDT 2011


Hi All,

I've faced with this problem: The WFS POST request that OpenLayers
performs does not contains following namespaces:
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"

The weird thing is that these namespaces are mentioned in test
expected value at OpenLayers\tests\Format\WFST\v1_1_0.html

...
<div id="getfeature0"><!--
<wfs:GetFeature service="WFS" version="1.1.0" resultType="hits"
xmlns:topp="http://www.openplans.org/topp"
                xmlns:wfs="http://www.opengis.net/wfs"
                xmlns:ogc="http://www.opengis.net/ogc"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
    <wfs:Query xmlns:wfs="http://www.opengis.net/wfs"
typeName="topp:states" xmlns:topp="http://www.openplans.org/topp">
        <wfs:PropertyName>STATE_NAME</wfs:PropertyName>
        <wfs:PropertyName>STATE_FIPS</wfs:PropertyName>
        <wfs:PropertyName>STATE_ABBR</wfs:PropertyName>
    </wfs:Query>
</wfs:GetFeature>
--></div>
...

I have analysed this test with FireBug and get following:

expected value (exp) is:

<wfs:GetFeature service="WFS" version="1.1.0" resultType="hits"
xmlns:topp="http://www.openplans.org/topp"
                xmlns:wfs="http://www.opengis.net/wfs"
                xmlns:ogc="http://www.opengis.net/ogc"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
    <wfs:Query xmlns:wfs="http://www.opengis.net/wfs"
typeName="topp:states" xmlns:topp="http://www.openplans.org/topp">
        <wfs:PropertyName>STATE_NAME</wfs:PropertyName>
        <wfs:PropertyName>STATE_FIPS</wfs:PropertyName>
        <wfs:PropertyName>STATE_ABBR</wfs:PropertyName>
    </wfs:Query>
</wfs:GetFeature>

And real value (got) is:

<wfs:GetFeature service="WFS" version="1.1.0" resultType="hits"
xsi:schemaLocation="http://www.opengis.net/wfs
http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
    <wfs:Query xmlns:wfs="http://www.opengis.net/wfs"
typeName="topp:states" xmlns:topp="http://www.openplans.org/topp">
        <wfs:PropertyName>STATE_NAME</wfs:PropertyName>
        <wfs:PropertyName>STATE_FIPS</wfs:PropertyName>
        <wfs:PropertyName>STATE_ABBR</wfs:PropertyName>
    </wfs:Query>
</wfs:GetFeature>

As you can see there is no topp, wfs, ogc, xsi namespaces but test is
resulted as PASSED.

The fact that mentioned namespaces are missed caused following problem
with the Geoserver:

<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">
 <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&quot;&gt;... @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&quot;&gt;... @1:139)
   </ows:ExceptionText>
 </ows:Exception>
</ows:ExceptionReport>

I heve reported this issue on the Geoserver users mail list but no response yet.

Please if anybody have any idea on this issue help me. I've search all
the internet with no luck. Maybe I've missed something?

Thanks,

Serge Markin


More information about the Users mailing list