WFS POST requests: "No template provided" error

Frank Steggink Frank.Steggink at BENTLEY.COM
Fri Nov 9 11:42:51 EST 2007


Or maybe it is no URL encoding. This morning I mentioned I got a timeout
(and later a 502 error) when I was posting to
http://map.ns.ec.gc.ca/MapServer/mapserv.exe?map=/mapserver/services/env
dat/config.map.
Well, it turned out that it depends on the presence of carriage returns
in the post data if it will succeed or not. 

Posting this will succeed (all on one line):
<?xml version="1.0" encoding="iso-8859-1"?><wfs:DescribeFeatureType
version="1.0.0" service="WFS"
xsi:schemaLocation="http://www.opengis.net/wfs
../wfs/1.0.0/WFS-basic.xsd" xmlns:wfs="http://www.opengis.net/wfs"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wfs:TypeName>wfs:
envirodat</wfs:TypeName></wfs:DescribeFeatureType>

Posting this will not:
<?xml version="1.0" encoding="iso-8859-1"?>
<wfs:DescribeFeatureType version="1.0.0" service="WFS"
xsi:schemaLocation="http://www.opengis.net/wfs
../wfs/1.0.0/WFS-basic.xsd" xmlns:wfs="http://www.opengis.net/wfs"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <wfs:TypeName>wfs:envirodat</wfs:TypeName>
</wfs:DescribeFeatureType>

The post data is not URL encoded. And posting the successful post body
to http://map.ns.ec.gc.ca/envdat/map.aspx gives the infamous "no
template provided" error.

Frank

-----Original Message-----
From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
Behalf Of Frank Steggink
Sent: Friday, November 09, 2007 10:53
To: MAPSERVER-USERS at LISTS.UMN.EDU
Subject: Re: [UMN_MAPSERVER-USERS] WFS POST requests: "No template
provided" error

Yewondwossen,

I've tested it with curl on the command line, with the post data in a
file, and it works. However, it doesn't work if I put the post data on
the command line. So it is probably a client issue after all. Since
curl's documentation mentions that the data should be URL escaped, that
is likely the problem. I'm not doing that for the WFS client, since it
gave too much problems with other servers. It will be a tough and bumpy
ride to get this working for all servers. I guess this is also Jukka's
problem. Yet another server quirk to deal with...

Frank

-----Original Message-----
From: Yewondwossen Assefa [mailto:yassefa at dmsolutions.ca]
Sent: Friday, November 09, 2007 09:57
To: Frank Steggink
Subject: Re: [UMN_MAPSERVER-USERS] WFS POST requests: "No template
provided" error

Attached is the script.

Frank Steggink wrote:
> Follow up. I've found and tested a few services:
> 
> 1.
> http://wfs.alaskamapped.org/inventory?SERVICE=WFS&VERSION=1.0.0&REQUES
> T= GetCapabilities& (from a post yesterday, MapServer 5.0 RC 2): I got

> an internal server error (500) with DescribeFeatureType/POST. The 
> online resource URL is the same.
> 2.
> http://www2.dmsolutions.ca/cgi-bin/mswfs_gmap?SERVICE=WFS&VERSION=1.0.
> 0& REQUEST=GetCapabilities& (MapServer 4.6.0): 
> DescribeFeatureType/POST and GetFeature/POST work here. As I mentioned

> before, I'm using the online resource URL's, which are different than 
> the base URL.
> 3.
> http://excise.pyr.ec.gc.ca/cgi-bin/mapserv.exe?map=/LocalApps/Mapsurfe
> r/ PYRWQMP.map&SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&
> (MapServer 4.8.1): The client timed out at DescribeFeatureType/POST.
> (GET, which I did in the browser, responded pretty quick.) After 5 
> minutes I finally got a response from the server, a 502 error (Bad 
> Gateway), with a CGI application timeout. This is probably a 
> configuration error, since the online resource is different.
> 
> It looks indeed that this is more due to configuration errors, than 
> that it is actually an error by MapServer. Since I have no experience 
> with Mapserver itself, it is hard to tell. Maybe it is coincident or 
> not, but the oldest Mapserver version seems to work best.
> 
> Yewondwossen, replying to the mail you just sent, can you send the 
> test script? Then I can see what are the actual differences. I have 
> logged my requests with Fiddler, and saved the sessions. In case 
> you're interested, I can send it to you as well.
> 
> Frank
> 
> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU]
> On Behalf Of Frank Steggink
> Sent: Friday, November 09, 2007 08:44
> To: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] WFS POST requests: "No template 
> provided" error
> 
> Hello Yewondwossen,
> 
> Sorry, no improvement here. I'm not getting an error, but I got a time

> out, while posting (DescribeFeatureType) to the original server URL 
> (http://map.ns.ec.gc.ca/MapServer/mapserv.exe?map=/mapserver/services/
> en
> vdat/config.map).
> Also, the other service I mentioned,
> http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp, uses this same URL as 
> online resources, which already gave the template error.
> 
> I'm a bit out of options right now. As already mentioned, when I'm 
> using GET, then everything works fine, so our client will be able to 
> access MapServer. I'll try a few other MapServer WFS's, and see what
they do.
> (Using POST, and the online resource URL's.) There are quite a lot of 
> them online. If they all give the same result, then I'm going to file 
> a bug in Trac. It is no coincidence if several servers, which are set 
> up independently, all have the same problem.
> 
> Frank
> 
> -----Original Message-----
> From: Yewondwossen Assefa [mailto:yassefa at dmsolutions.ca]
> Sent: Thursday, November 08, 2007 17:30
> To: Frank Steggink
> Cc: MAPSERVER-USERS at LISTS.UMN.EDU
> Subject: Re: [UMN_MAPSERVER-USERS] WFS POST requests: "No template 
> provided" error
> 
> Hi There,
> 
>   WFS POST is supported by MapServer. Looking into this thread, you 
> mentioned a couple of URLS and I have tried the follwing one :
> "http://map.ns.ec.gc.ca/MapServer/mapserv.exe?map=/mapserver/services/
> en
> vdat/config.map"
> 
>   I have tried WFS post requests  describefeature and getfeature  with

> this service and It responds correctly. It is a Mapserve 4.8.3.
> 
>   I am guessing that there is something 'wrong" with the service 
> accessed though the script at http://map.ns.ec.gc.ca/envdat/map.aspx
> where the post requests are not maybe transfered properly to
Mapserver.
> 
>   Hopefully this helps.
> 
> Best Regards,
> 
> 
> Frank Steggink wrote:
>> Hello Daniel,
>>
>> Thanks for the reply. I've tried your suggestion, but unfortunately 
>> it
> 
>> didn't work. I'm getting the following ServiceException:
>>
>> <ServiceExceptionReport
>> xmlns="http://www.opengis.net/ogc"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://www.opengis.net/ogc
>> http://schemas.opengis.net/wms/1.1.1/OGC-exception.xsd">
>>   <ServiceException>
>> msWFSDispatch(): WFS server error. Incomplete WFS request: VERSION 
>> parameter missing
>>   </ServiceException>
>> </ServiceExceptionReport>
>>
>> The URL is http://map.ns.ec.gc.ca/envdat/map.aspx?SERVICE=WFS& and 
>> the
> 
>> post data is the same as in the original message.
>>
>> It really looks like MapServer only accepts GET request for WFS. So, 
>> the simple fix you suggested will probably not be enough. I'm going 
>> to
> file a ticket.
>> In case
>> something needs to be tested, please let me know.
>>
>> Frank
>>
> 
> 
> --
> ----------------------------------------------------------------
> Assefa Yewondwossen
> Software Analyst
> 
> Email: assefa at dmsolutions.ca
> http://www.dmsolutions.ca/
> 
> Phone: (613) 565-5056 (ext 14)
> Fax:   (613) 565-0925
> ----------------------------------------------------------------
> 


--
----------------------------------------------------------------
Assefa Yewondwossen
Software Analyst

Email: assefa at dmsolutions.ca
http://www.dmsolutions.ca/

Phone: (613) 565-5056 (ext 14)
Fax:   (613) 565-0925
----------------------------------------------------------------



More information about the mapserver-users mailing list