Opened 21 years ago

Closed 15 years ago

#455 closed defect (fixed)

[WMS] GetCapabilities returns text/html asimage format

Reported by: dmorissette Owned by: assefa
Priority: high Milestone: 6.0 release
Component: WMS Server Version: 4.1
Severity: normal Keywords: wms formats
Cc: mapserver@…, tomkralidis

Description (last modified by dmorissette)

Brent Fraser wrote:
> 
>   The following is likely a Mapserver issue, but Mapserver 4.0 spits out
> 
> GetMap>
>   <Format>image/png</Format>
>   <Format>image/jpeg</Format>
>   <Format>text/html</Format>
>   <Format>image/tiff</Format>
> 
> when asked for REQUEST=GETCAPABILITIES
> 

I reproduced this with the GMap demo: http://www2.dmsolutions.ca/cgi-bin/mswms_gmap?request=getcapabilities

reutnrs the following formats:

 <Format>image/gif</Format>
 <Format>image/png</Format>
 <Format>image/jpeg</Format>
 <Format>image/wbmp</Format>
 <Format>application/x-shockwave-flash</Format>
 <Format>text/html</Format>
 <Format>application/x-pdf</Format>
 <Format>image/tiff</Format>

It must be that one of the default output formats in MapServer triggers this text/html thing which confuses some clients.

I even wonder if any/all of the non-image formats would work via the WMS interface. Each of them should be tested at least once.

For sure the text/html format didn't work for me when I tried it on the GMap WMS server.

Attachments (2)

bug455-patch.zip (1.8 KB ) - added by assefa 15 years ago.
patch againts mapserver-trunk
bug455-patch-2.zip (1.8 KB ) - added by assefa 15 years ago.
patch againts mapserver-trunk

Download all attachments as: .zip

Change History (22)

comment:1 by fwarmerdam, 20 years ago

Cc: warmerdam@… added
As discussed on the mailing list, there is also a need to be able to disable
predefine output formats from appearing in the WMS formats list. 

I don't like the idea of putting the directive about whether it would appear
in the capabilities document in the outputformat declaration itself, because 
then it would be hard to alter the settings for the built-in formats from
the map file.  Perhaps, instead, there should be a map level directive of
some sort providing a list of formats to be exposed for a particular service.
Keeping in mind we might want different subsets for different services 
(notably WMS and WCS).  The default presumably would be to expose all defined
formats, or perhaps only those with a mime type of image/something. 


comment:2 by dmorissette, 20 years ago

Milestone: 4.4 release

comment:3 by assefa, 19 years ago

I think we should create the default function for 4.4 release. The default 
function could be somethink like msGetRasterOutputFormatMimeList (driver 
starts with "GD/" or "GDAL/"). Adding this would solve the immediate problem 
that we have here.

We could then use later on the CONFIG in the map file (or other mecanism to 
let the user define what he wants).

  
 

comment:4 by fwarmerdam, 19 years ago

I agree. 

comment:5 by assefa, 19 years ago

Milestone: 4.4 releaseFUTURE
Fixed as per comment #2.

I will leave this open (and set it to FUTRUE) since we will need to instaure a 
user defined mecahnism to be able to advertize other formats.

I have created a bug for the docs to be updated (Bug 1072) 

comment:6 by assefa, 19 years ago

Milestone: FUTURE4.6 release
change traget to 4.6

comment:7 by ivano.picco@…, 19 years ago

blocked: 1347

comment:8 by bartvde@…, 18 years ago

I would be in favour of not re-using the name wms_format for this.

E.g. you could have the situation in which you would be cascading a wms layer
from a different wms server. You might want to advertize that layer in other
format(s) than you retrieve it.

comment:9 by fwarmerdam, 18 years ago

I'm not adverse to using a different metadata name for this, but it will
appear on the WEB metadata, not the layer metadata.  WMS formats are not
per layer. 

comment:10 by assefa, 18 years ago

The idea is to use a metadata ows/wms_formats or (wms_supported_formats)  at a 
web level  that would contain a comma separated list of mime types that would 
be advertized if valid (valid in this case means only testing if there is an 
output format defined for it, so basically if it is build with that output, It 
will be listed)
  If the metadata is not present, the current behaviour, which is advertizing 
only gd and gdal format, will be used.

 Is this ok ?   

comment:11 by mapserver@…, 18 years ago

Cc: mapserver@… added

comment:12 by assefa, 18 years ago

Cc: mapserver-bugs@… added
Owner: changed from mapserverbugs to assefa
looking into this.

comment:13 by assefa, 17 years ago

Milestone: 4.6 release5.0 release
change target to 5.0

comment:14 by assefa, 17 years ago

Milestone: 5.0 releaseFUTURE

by assefa, 15 years ago

Attachment: bug455-patch.zip added

patch againts mapserver-trunk

by assefa, 15 years ago

Attachment: bug455-patch-2.zip added

patch againts mapserver-trunk

comment:15 by assefa, 15 years ago

Keywords: wms formats added
Milestone: FUTURE6.0 release
Status: newassigned

bug455-patch-2.zip contains the patch against trunk.

The metadata to use is wms_getmap_formatlist "image/png,image/jpeg" I think the same logic should be applied to the getlegendgraphic. I did not add it until others comment on it.

comment:16 by assefa, 15 years ago

Other thing that needs to be corrected as part of this fix is the formats advertised for GetImage and GetLegndGraphic do not include AGG driver. There was a specific ticket for this that was used for the 5.4.x branch (#2957)

comment:17 by assefa, 15 years ago

Cc: tomkralidis added

this stalled after the debate we had in TO on not adding more metadata (in this case it was wms_getmap_formatlist). The patch I did in March/09 was tested by someone on the mailing list the time. I still find this a useful way to control what formats are exposed. Should we just set this bug as FUTURE and forget about it until it come back as a request?

comment:18 by dmorissette, 15 years ago

Description: modified (diff)

Are you alluding to my comments about the fact that we were abusing metadata and should find better ways to handle some stuff? (It was a comment/feeling, not a statemenet since I do not have a better alternative) Anyway, I don't remember if it was targeted specifically at this issue, but thinking about it now your wms_getmap_formatlist suggestion seems too make sense as a simple and useful fix and you have my +1.

comment:19 by assefa, 15 years ago

I was referring to the fact that there was a discussion/proposition to have a possible object structure to manage all the metadata. I am not sure I have the exact details but there was some kind of solution proposed on it. I know it did refer directly to this item but I was hesitant to add a new metadata at the time if we were going to use a new mechanism. Great I will reactivate the patch and finish it to support also getlegendgraphic request.

comment:20 by assefa, 15 years ago

Resolution: fixed
Status: assignedclosed

This was commuted before beta1 and notes added to the docs.

Note: See TracTickets for help on using tickets.