WFS POST requests: "No template provided" error

Frank Steggink Frank.Steggink at BENTLEY.COM
Thu Nov 8 07:36:21 PST 2007


Sean (and others),

As I said, the servers are not mine. They are public servers on the
internet. I'm just making a client, and care about interoperability, so
that's why I posted. (Even with a protocol which is flawed, but this is
what I'm paid for at this moment.)

I could try to set up MapServer myself, but since I've no MapServer
experience, it will take quite some time. That's why I was asking
someone else to look at it.

About this message, is there any difference in setting MapServer up to
handle GET and POST requests? If the "WFS handler for POST" isn't set up
correctly, why isn't this reflected in the Capabilities document?

Frank


-----Original Message-----
From: Sean Gillies [mailto:sgillies at frii.com] 
Sent: Thursday, November 08, 2007 10:05
To: MAPSERVER-USERS at LISTS.UMN.EDU
Cc: Frank Steggink
Subject: Re: WFS POST requests: "No template provided" error

POST is for creating new resource states! Use GET!

Oh, wait, wrong list :)

That "No template provided" error usually means what it says. Is your
mapfile configed properly? Are you able to render maps from it using the
shp2img utility?

Sean

Frank Steggink wrote:
> Hello List,
> 
> While developing a WFS client, I've encountered a problem with = 
> MapServer. I don't have a local setup of MapServer running, but use a 
> = few public available services at the web. Those are:
> *	=
> http://map.ns.ec.gc.ca/MapServer/mapserv.exe?map=3D/mapserver/services
> /en=
> vdat/config.map (MapServer 4.8.3)
> *	http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp (MapServer 4.8.1)
> 
> Our WFS client supports both GET and POST requests. It checks the = 
> Capabilities document which HTTP method to use. The document of the = 
> first service can be found here: = 
> http://map.ns.ec.gc.ca/MapServer/mapserv.exe?map=3D/mapserver/services
> /en= 
> vdat/config.map&SERVICE=3DWFS&VERSION=3D1.0.0&REQUEST=3DGetCapabilitie
> s&.=  GetCapabilities is always done with GET, but other requests can 
> vary. = For testing purposes I made POST the default HTTP method for 
> the = requests. When I try to do a DescribeFeatureType or a GetFeature

> to = these services with POST, I'm getting the following message:
> 
> <HTML>
> <HEAD><TITLE>MapServer Message</TITLE></HEAD>
> <!-- MapServer version 4.8.3 OUTPUT=3DGIF OUTPUT=3DPNG OUTPUT=3DJPEG =

> OUTPUT=3DWBMP OUTPUT=3DPDF OUTPUT=3DSWF OUTPUT=3DSVG SUPPORTS=3DPROJ =

> SUPPORTS=3DFREETYPE SUPPORTS=3DWMS_SERVER SUPPORTS=3DWMS_CLIENT = 
> SUPPORTS=3DWFS_SERVER SUPPORTS=3DWFS_CLIENT SUPPORTS=3DWCS_SERVER = 
> SUPPORTS=3DTHREADS SUPPORTS=3DGEOS INPUT=3DJPEG INPUT=3DPOSTGIS = 
> INPUT=3DOGR INPUT=3DGDAL INPUT=3DSHAPEFILE DEBUG=3DMSDEBUG --> <BODY 
> BGCOLOR=3D"#FFFFFF">
> mapserv(): Web application error. No template provided. <br> 
> </BODY></HTML>
> 
> The Capabilites document lists the online resource URL's for = 
> DescribeFeatureType and GetFeature, so POST should be allowed for 
> these = WFS requests. I'm sure that the WFS request is correct, since 
> it works = with other WFS servers, like Geoserver, and Oracle Spatial 
> Web Services, = and I can not find anything that might be wrong on my 
> side. Here is the = raw request (headers + post data):
> 
> POST /envdat/map.aspx HTTP/1.1
> Content-Type: text/xml
> Host: map.ns.ec.gc.ca
> Content-Length: 579
> Expect: 100-continue
> Proxy-Connection: Close
> 
> <?xml version=3D"1.0" encoding=3D"iso-8859-1"?> <DescribeFeatureType 
> version=3D"1.0.0" service=3D"WFS" = 
> xsi:schemaLocation=3D"http://www.opengis.net/wfs = 
> http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd" = 
> xmlns=3D"http://www.opengis.net/wfs" = 
> xmlns:b=3D"http://www.bentley.com/schemas/x-Bentley.XMLTemplate.0.1" =

> xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" = 
> xmlns:ows=3D"http://www.opengis.net/ows" = 
> xmlns:xlink=3D"http://www.w3.org/1999/xlink" = 
> xmlns:ogc=3D"http://www.opengis.net/ogc" = 
> xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema">
>   <TypeName>wfs:envirodat</TypeName>
> </DescribeFeatureType>
> 
> While searching the mailing list, I found replies of people suggesting

> = that WFS might not be enabled (MapServer not compiled with WFS 
> support), = but since WFS requests with GET work fine, this is 
> obviously not the = case. I also found another suggestion here: = 
> http://lists.umn.edu/cgi-bin/wa?S2=3DMAPSERVER-USERS&q=3Dwfs+post+temp
> lat= e&s=3D&f=3D&a=3D&b=3D. It is suggested to add the parameters = 
> "service=3DWFS" and "version=3D1.0.0" to the URL for POST, but this = 
> doesn't work either. Maybe I would need to test with a more recent = 
> build, but I couldn't find one at the web. But this would mean that I 
> = have to change the online resource URL, but the correct URL cannot 
> be = predicted. The correct URL to post to should be mentioned in the 
> = Capabilities document. The second service (www.bsc-eoc.org) returned

> the = same reply with the parameters, but the first service (at =
> map.ns.ec.gc.ca) returned this:
> 
> <ServiceExceptionReport
> xmlns=3D"http://www.opengis.net/ogc" = 
> xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" = 
> xsi:schemaLocation=3D"http://www.opengis.net/ogc = 
> http://schemas.opengis.net/wms/1.1.1/OGC-exception.xsd">
>   <ServiceException>
> msWFSDispatch(): WFS server error. Incomplete WFS request: REQUEST = 
> parameter missing
>   </ServiceException>
> </ServiceExceptionReport>
> 
> If I would add the Request parameter, then it would be WFS / GET 
> again, = and that's not what I want. (Well, I normally do, but this is

> for = testing purposes.) I was getting similar responses with 
> GetFeature, but since I changed my = code, the WFS client doesn't come

> that far (because DescribeFeatureType = doesn't work) anymore.=20
> 
> Since there are no problems with GET requests, our client can = 
> successfully query data. But since POST is also available, I would = 
> expect it to work as well. I hope that someone can look into this. If 
> = POST really causes problems, it would be better to remove the 
> associated = online resource URL's from the Capabilities document.
> 
> Regards,
> 
> Frank Steggink
> =20
> Bentley Systems, Inc.
> Software Developer Geospatial
> =20
> 3645, boul. Ste-Anne
> Qu=E9bec, Qc. G1E 3L1
> Canada
> =20
> Tel: +1 418 666 7691 ext. 289
> E-mail: frank.steggink at bentley.com
> WWW: http://www.bentley.com
> =20
> 



More information about the MapServer-users mailing list