Error for unsupported services is confusing (bug 2025)

Kralidis,Tom [Burlington] Tom.Kralidis at EC.GC.CA
Mon Feb 12 12:44:29 EST 2007


> Um... tricky one... see my comments below.
> 
> Frank Warmerdam wrote:
> > 
> > I would like to modify msOWSDispatch() to report a more 
> specific error 
> > message if the URL includes the string "SERVICE=" and none of the 
> > built in dispatchers handles the request.  Something along 
> the line of:
> > 
> >   "SERVICE '%s' is either not supported by MapServer, or 
> not enabled 
> > in this MapServer build"
> > 
> > or perhaps even embed specific logic to differentiate between 
> > unrecognised sevices, and ones which are definately not 
> built-in but could be.
> > 
> > The main drawback to this is if old style URLs might have 
> > "SERVICE=...." in them in some circumstances, as 
> msOWSDispatch() would 
> > never let control get past it.
> > 
> 
> Perhaps the best compromise would be to add a test at the end of
> msOWSDispatch() to return a meaningful error message if a 
> known service name was requested but the request was not 
> handled by any of the dispatch functions (i.e. likely because 
> the specified service was not compiled in). If service 
> contained any other value (not a recognized service name) 
> then msOWSDispatch() would return normally and let the 
> traditional CGI code kick in.
> 

But, if service == not a recognized service name, shouldn't an OGC
exception be returned in lieu of CGI mode kicking in?  The fact that
service=foo was passed (IMHO) would mean that the client is in an OGC
mode of some sort.

> e.g.
>   for(i=0; i<req->NumParams; i++) {
>      if (strcasecmp(req->ParamNames[i], "SERVICE") == 0) {
>          const char *service;
>          service = req->ParamValues[i];
>          if (strcasecmp(service, "WMS") != 0 &&
>              strcasecmp(service, "WFS") != 0 &&
>              strcasecmp(service, "WCS") != 0 &&
>              strcasecmp(service, "SOS") != 0 ) {
>             msSetError(MS_MISCERR, "SERVICE '%s' is either 
> not supported by MapServer, or not enabled in this MapServer 
> build", "msOWSDispatch()", service);
>             return MS_FAILURE;
>           }
>           break; /* No need to keep looping */
>        }
>      }
> 
> > I'm interested in opinions on the best approach to giving more 
> > meaningful error messages without any undue breakage.  I'm also 
> > interested in whether people think this change belongs in 
> 4.10.x (I'm 
> > inclined not too back port it).
> > 
> 
> Probably safer to not backport since this is not that 
> critical and there is a risk of breaking exisiting apps.
> 
> My 0.02$
> 



More information about the mapserver-dev mailing list