<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.3395" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008>Hi,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>I'm hoping someone
can help, I've been trying to get Perl mapscript to work using a couple of
examples from the "MapScript wrappers for WxS Services" page <A
href="http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript">http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript</A></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>Using python
mapscript it works, when I run it on the command line I get xml
output, h<SPAN class=035542200-27112008>owever if I try doing the same using
perl mapscript I get no xml output on the command line, I get
errors telling me that I cannot set the SERVICE, VERSION or REQUEST
parameters. I've included the python and perl scripts and their respective
map files below. If I try using $req->loadParams() in the script,
and pass the same parameters as part of the query string, then do a wget I get a
zero length file.</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008></SPAN></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008>Am I doing something wrong? Or is there a bug in
perl mapscript?</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008></SPAN></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008>Cheers - Justyna.</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008>===========================================</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008>#!/usr/bin/python</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>import
mapscript</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>req =
mapscript.OWSRequest()<BR>req.setParameter( 'SERVICE', 'WMS'
)<BR>req.setParameter( 'VERSION', '1.1.0' )<BR>req.setParameter( 'REQUEST',
'GetCapabilities' )</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>map =
mapscript.mapObj( 'test.map' )<BR>map.OWSDispatch( req )</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008>===========================================</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008></SPAN></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>with the following
map file</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008>===========================================</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>MAP<BR> SIZE
600 300<BR> EXTENT -180 -90 180 90<BR> IMAGECOLOR 180 180
250<BR> IMAGETYPE PNG</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008> UNITS
DD<BR> WEB<BR> IMAGEPATH
"/html/tmp/wms"<BR> IMAGEURL "/tmp/"<BR>
METADATA<BR> OWS_ONLINERESOURCE "<A
href="http://servername/test.py">http://servername/test.py</A>"<BR>
END<BR> END</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>
LAYER<BR> NAME "coast_polygon"<BR>
TYPE POLYGON<BR> STATUS DEFAULT<BR>
DATA coast<BR> CLASS<BR> COLOR
231 220 189<BR> OUTLINECOLOR 198 134
0<BR> NAME "Coast "<BR>
END<BR> END</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008>END</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008>===========================================</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>I get the following
errors using perl mapscript:</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>cannot set wms
parameter at ./test3.pl line 6.<BR>cannot set version parameter at
./test3.pl line 7.<BR>cannot set request parameter at ./test3.pl line
8.</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008>===========================================</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>#!/usr/bin/perl
-w</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>use
mapscript;</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>$req = new
mapscript::OWSRequest() or die "no
request";<BR>$req->setParameter('SERVICE','WMS') or warn "cannot set wms
parameter $!";<BR>$req->setParameter('VERSION','1.1.1') or warn "cannot set
version parameter $!";<BR>$req->setParameter('REQUEST','GetCapabilities') or
warn "cannot set request parameter $!";</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>$map = new
mapscript::mapObj("test3.map") or die "no object";</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008>$map->OWSDispatch( $req ) or die "cannot
dispatch";</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008>===========================================</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008></SPAN></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>and its mapfile
is</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008>===========================================</SPAN></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>MAP<BR> SIZE
600 300<BR> EXTENT -180 -90 180 90<BR> IMAGECOLOR 180 180
250<BR> IMAGETYPE PNG</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008> UNITS
DD<BR> WEB<BR> IMAGEPATH
"/html/tmp/wms"<BR> IMAGEURL "/tmp/"<BR>
METADATA<BR> OWS_ONLINERESOURCE <A
href="http://servername/test3.pl">http://servername/test3.pl</A><BR>
END<BR> END</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008>
LAYER<BR> NAME "coast_polygon"<BR>
TYPE POLYGON<BR> STATUS DEFAULT<BR>
DATA coast<BR> CLASS<BR> COLOR
231 220 189<BR> OUTLINECOLOR 198 134
0<BR> NAME "Coast "<BR>
END<BR> END<BR>END</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008><SPAN
class=035542200-27112008>===========================================</SPAN></SPAN></FONT><FONT
face=Arial size=2><SPAN class=035542200-27112008></DIV>
<DIV><BR></DIV>
<DIV><BR></SPAN></FONT><FONT face=Arial size=2><SPAN
class=035542200-27112008><BR></DIV>
<DIV><BR></DIV></SPAN></FONT>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=035542200-27112008> </DIV>
<DIV><BR></DIV></SPAN></FONT>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=035542200-27112008></SPAN></FONT> </DIV></BODY></HTML>