Did you solve this? This kind of stuff could happen if you have multiple copies of GDAL/OGR installed on the system, one with Xerces and one without. Make sure your script is really using the copy of GDAL/OGR that you think it is.

On 11-05-19 08:37 AM, Jachym Cepicky wrote:
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




_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users


--
Daniel Morissette
http://www.mapgears.com/
Provider of Professional MapServer Support since 2000

_______________________________________________
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to