MapServer with MapInfo (WFS)

Francesco Antognini fantognini at GMAIL.COM
Wed May 3 10:35:49 EDT 2006


Unfortunately I happened to read that page thoroughly only *after* posting
to the list....
Anyway. Yes it works but with a list of caveat.

First of all none of the solutions on that page were ideal for me since IIS
is currently a requirement and I would need to serve more than just 1 wfs
map file. The snippet of asp code is useless as it does not support POST
requests or setting environment variables.
So I wrote my own piece of php code which sets MS_MAPFILE and pipes the
input body to mapserv.exe. That does the trick and makes it possible to
serve several map files just by changing the URI.

The second problem is more tricky. I really haven't done thorough testing on
different platforms and versions, so it might be a specific issue with the
windows version.
Apparently mapserv.exe has a problem reading XML POST requests when lines
are terminated by CR/LF. Depending on the setup/configuration, either it
replies the messages "body is short" or just sits there waiting until it
time outs.
Unfortunately MapInfo seems to do just that, as it adds two CR/LF, one after
the XML declaration, the other as the last characters. So I updated the same
php script to strip CR from the POST body and reset the content-length
header (actually a CGI environment variable).

After that last change Mapinfo was able to successfully download the wfs
layers into a local table.
Hope this turns out to be helpful.

Also, maybe someone can give a feedback on the CR/LF issue?

Francesco

On 5/2/06, Daniel Morissette <dmorissette at mapgears.com> wrote:
>
> Francesco,
>
> Have you tried using a wrapper script to pass the map parameter via the
> MS_MAPFILE environment variable using one of the methods suggested in
> the WMS server howto at:
>
> http://mapserver.gis.umn.edu/docs/howto/wms_server/#more-about-the-online-resource-url
>
> I would be interested to know if MapInfo works if the map path is passed
> this way.
>
> Daniel
>
>
> Francesco Antognini wrote:
> > Hello
> > I think I'm stuck on a similar problem and maybe I can give further
> > information.
> > I'm basically doing the same thing, testing the WFS service with Mapinfo
> > and while a GetFeature issued from a browser works fine, the same thing
> > done from Mapinfo doesn't work. (WMS works fine)
> >
> > After poking around with various tools, I start to believe this might be
> > a POST vs. GET issue.
> > A browser works with GET requests and appends parameters to the URL,
> > including the vital map path. This works fine.
> > However MapServer in GetCapabilities advertises the POST services too,
> > and some clients will indeed send their requests as POST of XML data.
> > Mapinfo does it for sure.
> > Now: no matter what workaround I use to bring the map into the request,
> > this will still appear as an URL parameter, while the rest of the
> > request is posted as XML.
> > My feeling is that mapserv.exe gets confused about this and thinks that
> > this is really a GET request and starts complaining in various ways
> > about lack of parameters.
> >
> > If that's the real issue, then I can think of some workarounds. The
> > first being how to reinject the map into the request without using a URL
> > parameter. Any idea?
> >
> > Hope I haven't been too confusing
> > TIA
> > F.Antognini
> >
> >
> > On 4/26/06, *Léveillé, James* < James.Leveille at mtq.gouv.qc.ca
> > <mailto:James.Leveille at mtq.gouv.qc.ca>> wrote:
> >
> >     Hi all,
> >
> >     I'm trying to test MapServer (v 4.8.3), the WFS service, with
> >     MapInfo (v 8.0) and keep having this error message:
> >
> >     *"The WFS Server returned data which was neither in the requested
> >     format nor a recognized WFS service exception : POST body is short.*
> >     *In response to a DescribeFeatureType request, the WFS Server
> >     returned an invalid feature type."*
> >
> >     The GetCapabilities looks fine, and the GetFeature works fine with
> >     IE ...
> >     Here is my (simple) MapFile.
> >
> >     THANKS A LOT !!!
> >     <snip>
> >
> >     ...................
> >
> >      </snip>
> >
> >     __________________________________________
> >     *James Léveillé*
> >
> >     *Intélec Géomatique*
> >     420, boul. Charest Est
> >     Bureau 400
> >     Québec (QC), Canada
> >     G1K 8M4
> >
> >     Intélec Géomatique: 418.687.5000
> >     MTQ: 418.380.2005 (#227)
> >
> >
> > --
> > Francesco Antognini
> > Computer Consultant
> > Switzerland
> > fantognini at gmail.com <mailto:fantognini at gmail.com>
>
>
> --
> Daniel Morissette
> http://www.mapgears.com/
>



--
Francesco Antognini
Computer Consultant
Switzerland
fantognini at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060503/2bd87442/attachment.html


More information about the mapserver-users mailing list