WFS POST requests: "No template provided" error

Sean Gillies sgillies at FRII.COM
Thu Nov 8 07:53:07 PST 2007


Sorry, I got lost in the XML and HTTP weeds and forget you were using
foreign services. Like Daniel said, MapServer has a problem caused by
the way it overloads its single service endpoint. You might want to test
against a server that gets it right: GeoServer, or MapServer proxied
through another script.

Sean

Frank Steggink wrote:
> 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]=20
> 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,
>> =20
>> While developing a WFS client, I've encountered a problem with =3D=20
>> MapServer. I don't have a local setup of MapServer running, but use a=20
>> =3D few public available services at the web. Those are:
>> *	=3D
>> =
> http://map.ns.ec.gc.ca/MapServer/mapserv.exe?map=3D3D/mapserver/services
>> /en=3D
>> vdat/config.map (MapServer 4.8.3)
>> *	http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp (MapServer 4.8.1)
>> =20
>> Our WFS client supports both GET and POST requests. It checks the =3D=20
>> Capabilities document which HTTP method to use. The document of the =
> =3D=20
>> first service can be found here: =3D=20
>> =
> http://map.ns.ec.gc.ca/MapServer/mapserv.exe?map=3D3D/mapserver/services
>> /en=3D=20
>> =
> vdat/config.map&SERVICE=3D3DWFS&VERSION=3D3D1.0.0&REQUEST=3D3DGetCapabili=
> tie
>> s&.=3D  GetCapabilities is always done with GET, but other requests =
> can=20
>> vary. =3D For testing purposes I made POST the default HTTP method for =
> 
>> the =3D requests. When I try to do a DescribeFeatureType or a =
> GetFeature
> 
>> to =3D these services with POST, I'm getting the following message:
>> =20
>> <HTML>
>> <HEAD><TITLE>MapServer Message</TITLE></HEAD>
>> <!-- MapServer version 4.8.3 OUTPUT=3D3DGIF OUTPUT=3D3DPNG =
> OUTPUT=3D3DJPEG =3D
> 
>> OUTPUT=3D3DWBMP OUTPUT=3D3DPDF OUTPUT=3D3DSWF OUTPUT=3D3DSVG =
> SUPPORTS=3D3DPROJ =3D
> 
>> SUPPORTS=3D3DFREETYPE SUPPORTS=3D3DWMS_SERVER SUPPORTS=3D3DWMS_CLIENT =
> =3D=20
>> SUPPORTS=3D3DWFS_SERVER SUPPORTS=3D3DWFS_CLIENT =
> SUPPORTS=3D3DWCS_SERVER =3D=20
>> SUPPORTS=3D3DTHREADS SUPPORTS=3D3DGEOS INPUT=3D3DJPEG =
> INPUT=3D3DPOSTGIS =3D=20
>> INPUT=3D3DOGR INPUT=3D3DGDAL INPUT=3D3DSHAPEFILE DEBUG=3D3DMSDEBUG --> =
> <BODY=20
>> BGCOLOR=3D3D"#FFFFFF">
>> mapserv(): Web application error. No template provided. <br>=20
>> </BODY></HTML>
>> =20
>> The Capabilites document lists the online resource URL's for =3D=20
>> DescribeFeatureType and GetFeature, so POST should be allowed for=20
>> these =3D WFS requests. I'm sure that the WFS request is correct, =
> since=20
>> it works =3D with other WFS servers, like Geoserver, and Oracle =
> Spatial=20
>> Web Services, =3D and I can not find anything that might be wrong on =
> my=20
>> side. Here is the =3D raw request (headers + post data):
>> =20
>> 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
>> =20
>> <?xml version=3D3D"1.0" encoding=3D3D"iso-8859-1"?> =
> <DescribeFeatureType=20
>> version=3D3D"1.0.0" service=3D3D"WFS" =3D=20
>> xsi:schemaLocation=3D3D"http://www.opengis.net/wfs =3D=20
>> http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd" =3D=20
>> xmlns=3D3D"http://www.opengis.net/wfs" =3D=20
>> xmlns:b=3D3D"http://www.bentley.com/schemas/x-Bentley.XMLTemplate.0.1" =
> =3D
> 
>> xmlns:xsi=3D3D"http://www.w3.org/2001/XMLSchema-instance" =3D=20
>> xmlns:ows=3D3D"http://www.opengis.net/ows" =3D=20
>> xmlns:xlink=3D3D"http://www.w3.org/1999/xlink" =3D=20
>> xmlns:ogc=3D3D"http://www.opengis.net/ogc" =3D=20
>> xmlns:xsd=3D3D"http://www.w3.org/2001/XMLSchema">
>>   <TypeName>wfs:envirodat</TypeName>
>> </DescribeFeatureType>
>> =20
>> While searching the mailing list, I found replies of people suggesting
> 
>> =3D that WFS might not be enabled (MapServer not compiled with WFS=20
>> support), =3D but since WFS requests with GET work fine, this is=20
>> obviously not the =3D case. I also found another suggestion here: =3D=20
>> =
> http://lists.umn.edu/cgi-bin/wa?S2=3D3DMAPSERVER-USERS&q=3D3Dwfs+post+tem=
> p
>> lat=3D e&s=3D3D&f=3D3D&a=3D3D&b=3D3D. It is suggested to add the =
> parameters =3D=20
>> "service=3D3DWFS" and "version=3D3D1.0.0" to the URL for POST, but =
> this =3D=20
>> doesn't work either. Maybe I would need to test with a more recent =3D =
> 
>> build, but I couldn't find one at the web. But this would mean that I=20
>> =3D have to change the online resource URL, but the correct URL cannot =
> 
>> be =3D predicted. The correct URL to post to should be mentioned in =
> the=20
>> =3D Capabilities document. The second service (www.bsc-eoc.org) =
> returned
> 
>> the =3D same reply with the parameters, but the first service (at =3D
>> map.ns.ec.gc.ca) returned this:
>> =20
>> <ServiceExceptionReport
>> xmlns=3D3D"http://www.opengis.net/ogc" =3D=20
>> xmlns:xsi=3D3D"http://www.w3.org/2001/XMLSchema-instance" =3D=20
>> xsi:schemaLocation=3D3D"http://www.opengis.net/ogc =3D=20
>> http://schemas.opengis.net/wms/1.1.1/OGC-exception.xsd">
>>   <ServiceException>
>> msWFSDispatch(): WFS server error. Incomplete WFS request: REQUEST =3D =
> 
>> parameter missing
>>   </ServiceException>
>> </ServiceExceptionReport>
>> =20
>> If I would add the Request parameter, then it would be WFS / GET=20
>> again, =3D and that's not what I want. (Well, I normally do, but this =
> is
> 
>> for =3D testing purposes.) I was getting similar responses with=20
>> GetFeature, but since I changed my =3D code, the WFS client doesn't =
> come
> 
>> that far (because DescribeFeatureType =3D doesn't work) anymore.=3D20
>> =20
>> Since there are no problems with GET requests, our client can =3D=20
>> successfully query data. But since POST is also available, I would =3D =
> 
>> expect it to work as well. I hope that someone can look into this. If=20
>> =3D POST really causes problems, it would be better to remove the=20
>> associated =3D online resource URL's from the Capabilities document.
>> =20
>> Regards,
>> =20
>> Frank Steggink
>> =3D20
>> Bentley Systems, Inc.
>> Software Developer Geospatial
>> =3D20
>> 3645, boul. Ste-Anne
>> Qu=3DE9bec, Qc. G1E 3L1
>> Canada
>> =3D20
>> Tel: +1 418 666 7691 ext. 289
>> E-mail: frank.steggink at bentley.com
>> WWW: http://www.bentley.com
>> =3D20
>> =20
> 



More information about the MapServer-users mailing list