[mapserver-users] WFS - invalid XML in POST request?

Miloslav Kmeť miloslav.kmet at gmail.com
Thu Apr 15 18:10:06 EDT 2010


Hi. I am trying to get working WFS with POST request method. My layer def:
  
LAYER
    DEBUG 5
    NAME "MCHU"
    STATUS ON
    TYPE POLYGON
    CONNECTIONTYPE WFS
    CONNECTION 
"http://globus.sazp.sk/arcgis/services/nipi/protected_sites/MapServer/WFSServer"
    
    METADATA
      "wfs_version" "1.0.0"
      "wfs_service" "WFS"
      "wfs_srs" "epsg:102067"
      "wfs_typename" "nps:MCHU"
      "wfs_maxfeatures" "10000"      
    END
END

( http://pastebin.ca/1862437 )

I read in the documentation, that without wfs_request_method in METADATA the 
default request method is POST.

When mapserver do POST, the WFS service complains:
Xml Parsing failed. Reason:Reference to undeclared namespace prefix: 'wfs'.

Below is the full communication between mapserver and ArcGIS server. It seems 
like, there are some namespace declaration missing, but I  cannot figure out 
the right request XML.

Thanks

( http://pastebin.ca/1862442 ):

POST /arcgis/services/nipi/protected_sites/MapServer/WFSServer HTTP/1.1
User-Agent: MapServer/5.6.3 libcurl/7.19.7
Host: globus.sazp.sk
Accept: */*
Content-Type: text/xml
Content-Length: 386

<?xml version="1.0" ?>
<wfs:GetFeature
service="WFS"
version="1.0.0"
maxFeatures="10000"
outputFormat="GML2">
<wfs:Query typeName="nps:MCHU">
<ogc:Filter>
<ogc:BBOX>
<ogc:PropertyName>Geometry</ogc:PropertyName>
<gml:Box>
<gml:coordinates>-613875.000000,-1351366.235392 
-143625.000000,-1116633.764608</gml:coordinates>
</gml:Box>
</ogc:BBOX>
</ogc:Filter></wfs:Query>
</wfs:GetFeature>
HTTP/1.1 200 OK
Date: Thu, 15 Apr 2010 20:28:35 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private
Content-Type: text/xml
Content-Length: 358

<ows:ExceptionReport version='1.1.0' language='en' 
xmlns:ows='http://www.opengis.net/ows'><ows:Exception 
exceptionCode='NoApplicableCode'><ows:ExceptionText>Xml Parsing failed.
Reason:Reference to undeclared namespace prefix: &apos;wfs&apos;.

Linepos:21
Source:outputFormat=&quot;GML2&quot;&gt;.</ows:ExceptionText></ows:Exception></ows:ExceptionReport>
-- 
Miloslav Kmeť


More information about the mapserver-users mailing list