RE: [mapserver-users] how to throw a custom ExceptionReport
> -Original Message- > From: Charlton Galvarino [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 10 December 2008 14:52 > To: Kralidis,Tom [Ontario]; mapserver-users@lists.osgeo.org > Subject: RE: [mapserver-users] how to throw a custom ExceptionReport > > Tom, I've thought about this long and hard, and I can't wrap > my head around it. > > > You can use Perl mapscript WxS to intercept and return a custom > > exception. Check out > > http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript for info and > > examples. > > It looks like those examples are doing what I'm doing in the > end . . . dumping out XML. But perhaps what I need > accomplished is a bit trickier? I don't think I explained in > enough detail what I'm doing. > > I have a .map that contains something like: > > # demo.map > LAYER > NAME wind_wave_period_and_direction > PROJECTION > "init=epsg:4269" > END > TYPE RASTER > STATUS OFF > CONNECTION "http://localhost/viz"; > CONNECTIONTYPE WMS > METADATA > "ows_title" "wind_wave_period_and_direction" > "wms_extent" "-100 5 -60 50" > "wms_srs" "EPSG:4269" > "wms_name""ww3dir_info" > "wms_server_version" "1.1.1" > "wms_format" "image/png" > "wms_connectiontimeout" "90" > END > > So what I'm really doing is a cascade WMS request because I'm > asking that .amp for the wind_wave_period_and_direction > layer. http://localhost/mapserv?map=demo.map. > > The thing that I need to throw the error is the viz CGI in > the CONNECTION string above. > > So perhaps my question boils down to . . . > > What could viz spit out so that this WMS request would know > it sees an error via something like > EXCEPTIONS=application/vnd.ogc.se_inimage? What I'm getting > now, instead, is the MapServer error saying that the WMS > returned an XML exception. Well, yes, it did -- but I want > to SEE it! :) > Looks like Charlton wants to show the ExceptionText from a remote WMS's service exception. I'm not sure you can do this as it stands right now without some custom work. Options/comments: - you'd have to ensure the remote WMS support application/vnd.ogc.se_xml - can you catch an error when doing a remote WMS request from the mapscript object model? Others may have better ideas. Having said this, I think this would be a valuable enhancement to the codebase, i.e. allowing to show cascaded ExceptionReport XML. The ExceptionReport XML model allows for multiplicitity of Exception elements, so we could stack these to show the generic MapServer error, as well as the cascaded, say, WMS Exception/ExceptionText. ..Tom > TIA. > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] how to throw a custom ExceptionReport
Tom, I've thought about this long and hard, and I can't wrap my head around it. > You can use Perl mapscript WxS to intercept and return a custom > exception. Check out > http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript for info and > examples. It looks like those examples are doing what I'm doing in the end . . . dumping out XML. But perhaps what I need accomplished is a bit trickier? I don't think I explained in enough detail what I'm doing. I have a .map that contains something like: # demo.map LAYER NAME wind_wave_period_and_direction PROJECTION "init=epsg:4269" END TYPE RASTER STATUS OFF CONNECTION "http://localhost/viz"; CONNECTIONTYPE WMS METADATA "ows_title" "wind_wave_period_and_direction" "wms_extent" "-100 5 -60 50" "wms_srs" "EPSG:4269" "wms_name""ww3dir_info" "wms_server_version" "1.1.1" "wms_format" "image/png" "wms_connectiontimeout" "90" END So what I'm really doing is a cascade WMS request because I'm asking that .amp for the wind_wave_period_and_direction layer. http://localhost/mapserv?map=demo.map. The thing that I need to throw the error is the viz CGI in the CONNECTION string above. So perhaps my question boils down to . . . What could viz spit out so that this WMS request would know it sees an error via something like EXCEPTIONS=application/vnd.ogc.se_inimage? What I'm getting now, instead, is the MapServer error saying that the WMS returned an XML exception. Well, yes, it did -- but I want to SEE it! :) TIA. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] how to throw a custom ExceptionReport
> You can use Perl mapscript WxS to intercept and return a custom > exception. Check out > http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript for info and > examples. Funny, I remember that link flying by recently. Thanks, Tom, I'll give that a shot. ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users
RE: [mapserver-users] how to throw a custom ExceptionReport
> -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Charlton Galvarino > Sent: Wednesday, 10 December 2008 11:36 > To: Mapserver Users (mapserver-users@lists.osgeo.org) > Subject: [mapserver-users] how to throw a custom ExceptionReport > > Hi, all. I intercept WMS calls on a regular basis using Perl > CGI and a final print redirect('mapserv?...'); to actually > send the WMS request along. > > I have the case where I'd like to throw a custom > ExceptionReport, but I haven't had much luck so far in > getting mapserver not to misunderstand it and throw its own > WMS ServiceException. > > What I'm trying to do is to communicate to the user, "Hey, > you've asked for a file I don't have." > > So what I have is an incoming WMS request. I snag the > request, try to find a matching file. If I find it, great, I > send the image generation request along and pass it back > thru. If it doesn't, I'd like to spit out the XML message. > > I copied the structure of a mapserver msg and tried making it my own. > > print $query->header('text/xml'); > print < > "http://schemas.opengeospatial.net/wms/1.1.1/exception_1_1_1.dtd";> > > Sorry, Charlie, you're out of luck. > > > EOH > exit; > > But I think I'm confusing myself of how my error messages > interface w/ mapserver's. > You can use Perl mapscript WxS to intercept and return a custom exception. Check out http://mapserver.gis.umn.edu/docs/howto/wxs_mapscript for info and examples. Hope this helps. ..Tom > Thanks for any advice. > > > > > Charlton Galvarino > 1 (803) 233-6205 : voice > 1 (803) 223-9579 : fax > [EMAIL PROTECTED] > > P.O. Box 50960 > Columbia, SC 29250 > > ___ > mapserver-users mailing list > mapserver-users@lists.osgeo.org > http://lists.osgeo.org/mailman/listinfo/mapserver-users > ___ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users