Overriding WMS parameters for 'strange' WMS servers

Bart van den Eijnden bartvde at XS4ALL.NL
Thu Feb 17 04:23:46 EST 2005


Hi Havard,

looking at the source code, Mapserver WMS client, always uses the inimage
type of exceptions in its WMS request:

        if (nVersion >= OWS_1_1_0)
            pszExceptionsParam = "application/vnd.ogc.se_inimage";
        else
            pszExceptionsParam = "INIMAGE";

But, application/vnd.ogc.se_inimage is an *optional* exception format in
the WMS spec, so I think your idea would be good of being able to override
this as a user. This is a necessary enhancement, since the default
requested exception format is an optional one, and I would suggest you to
open an enhancement bug for this in the Mapserver bugzilla. Something like
wms_exception_format/ows_exception_format METADATA.

This may also involve some more error handling in Mapserver WMS client
though, since it is not expecting XML type of exceptions for GetMap right
now. So it might not be as straightforward as it looks to implement this.

Best regards,
Bart

> Some WMS server implementations are a little "strange" (perhaps
> not fully implementing the standards). It would therefore be
> very nice to be able to override the WMS parameters
> sent by UMN Mapserver to the remote WMS server.
>
> This time it is the EXCEPTIONS parameter that is causing me
> trouble. The WMS server I am trying to use only supports
> "application/vnd.ogc.se_xml" (as advertised in the capabilities),
> and responds with an error message if Mapservers "default"
> EXCEPTIONS=application/vnd.ogc.se_inimage is received. This
> causes the Mapserver application to fail.
> In other cases I have experienced case sensitivity problems.
>
> It would be nice to be able to override the WMS parameters that
> are sent by Mapserver in some way (even if Mapserver behaviour
> is according to the standards).
> Is there a way to do this? (I have tried to find something in
> the documentation, bugzilla and the email archives)
>
> One way of doing this would be to parse the string given in
> "CONNECTION", and not providing Mapserver parameters for the
> parameters that have already been supplied in the
> CONNECTION-string.
>
> If for instance
> CONNECTION "http://an.url/a/service?&VERSION=1.1.1\
> &LAYERS=layer1&STYLES=default&FORMAT=image/png
>
> makes mapserver generate the request:
> http://an.url/a/service?.......&BBOX....&EXCEPTIONS=application/vnd.ogc.se_inimage
>
> Then the following request:
> CONNECTION "http://an.url/a/service?&VERSION=1.1.1\
> &LAYERS=layer1&STYLES=default&FORMAT=image/png\
> &Exceptions=application/vnd.ogc.se_xml"
>
> should make mapserver generate the request:
> http://an.url/a/service?.......&Exceptions=application/vnd.ogc.se_xml...&BBOX....
>
> Currently the following is generated:
> http://an.url/a/service?.......&Exceptions=application/vnd.ogc.se_xml...&BBOX....&EXCEPTIONS=application/vnd.ogc.se_inimage
> (which causes the WMS server I am trying to use to respond
> with an error)
>
> --
> Håvard Tveite
> Department of Mathematical Sciences and Technology, UMB
> Drøbakveien 14, POBox 5003, N-1432 Ås, NORWAY
> Phone: +47 64965483 Fax: +47 64965401 http://www.umb.no/imt
>



More information about the mapserver-users mailing list