[mapserver-users] mapscript owsdispatch does not work, cgi mapserver does

Jachym Cepicky jachym.cepicky at gmail.com
Thu May 19 08:37:42 EDT 2011


Hi,

I have strange problem, I need to use mapobject.OWSDispatch with WMS
GetMap request, and I do expect image at the output.

I have prepared small python wrapper script, which should load the
mapfile, perform owsdispatch and return the result. It does not work
(saying something about missing xerces support, which is not true, see
below).

When I use *exactly the same* mapfile, but with simple shell wrapper
(so no mapscript), it works perfectly.

Examples:

(1) Shell script wrapper:

#!/bin/sh
export MS_MAPFILE="/tmp/wfs02.map"
/usr/lib/cgi-bin/mapserv

http://localhost/cgi-bin/owsviewer2.sh?LAYERS=kraje&TRANSPARENT=TRUE&FORMAT=image%2Fpng&EXCEPTIONS=XML&VERSION=1.3.0&STYLES=default&CRS=EPSG%3A4326&SERVICE=WMS&REQUEST=GetMap&BBOX=49,12,51,18&WIDTH=1000&HEIGHT=634

-> Image is returned



(2) Python script:

#!/usr/bin/python
import mapscript
mapobj = mapscript.mapObj("/tmp/wfs02.map")
request = mapscript.OWSRequest()
request.loadParams()
print mapobj.OWSDispatch(request)

http://localhost/cgi-bin/owsviewer2.py?LAYERS=kraje&TRANSPARENT=TRUE&FORMAT=image%2Fpng&EXCEPTIONS=XML&VERSION=1.3.0&STYLES=default&CRS=EPSG%3A4326&SERVICE=WMS&REQUEST=GetMap&BBOX=49,12,51,18&WIDTH=1000&HEIGHT=634

->

<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
<ServiceExceptionReport version="1.3.0"
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.3.0/exceptions_1_3_0.xsd">
<ServiceException>
msDrawMap(): Image handling error. Failed to draw layer named &#39;kraje&#39;.
msOGRFileOpen(): OGR error. Open failed for OGR connection in layer `kraje&#39;.
File /tmp/mapserv/4dd50e3f_54c_0..tmp.gml appears to be GML but the
GML reader can&#39;t
be instantiated, likely because Xerces support wasn&#39;t
configured in.

</ServiceException>
</ServiceExceptionReport>

What am I doing wrong?

Thanks

Jachym

-- 
Jachym Cepicky
e-mail: jachym.cepicky gmail com
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/pgp/JachymCepicky.pgp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: wfs02.map
Type: application/octet-stream
Size: 1097 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110519/55c4bec0/wfs02.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: owsviewer2.sh
Type: application/x-sh
Size: 71 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110519/55c4bec0/owsviewer2.sh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: owsviewer2.py
Type: text/x-python
Size: 168 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20110519/55c4bec0/owsviewer2.py


More information about the mapserver-users mailing list