Opened 20 years ago

Closed 20 years ago

#683 closed defect (fixed)

DescribeLayer response -> no DTD and some other comments

Reported by: tomkralidis Owned by: mapserverbugs
Priority: high Milestone: 4.4 release
Component: WMS Server Version: 4.2
Severity: normal Keywords:
Cc:

Description

Hi,

(using 4.2b3), if I issue something like:

http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/apps/mum2_ogc_workshop/service/config.map&version=1.1.1&service=WMS&request=DescribeLayer&layers=rivers

I get back:

<?xml version='1.0' encoding="ISO-8859-1"?>
<!DOCTYPE WMS_DescribeLayerResponse>
<WMS_DescribeLayerResponse version="1.1.0" >
<LayerDescription name="rivers"
wfs="http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/apps/mum2_ogc_workshop/service/config.map">
<Query typeName="rivers" />
</LayerDescription>
</WMS_DescribeLayerResponse>

Must fix:
The response currently chokes on a validating XML parser.  The DOCTYPE
declaration should point to the DTD at:
http://schemas.opengis.net/wms/1.1.1/WMS_DescribeLayerResponse.dtd


Keep in mind:
This should also encapsulate OGC:WCS when MapServer officially supports it, i.e.:

owsType="WCS" owsURL="<server_url_goes_here>"

Infact, I'd prefer if we used the owsType/owsURL attributes for everything,
instead of using the wfs attribute for WFS-based data, i.e.

<?xml version='1.0' encoding="ISO-8859-1"?>
<!DOCTYPE WMS_DescribeLayerResponse SYSTEM
"http://schemas.opengis.net/wms/1.1.1/WMS_DescribeLayerResponse.dtd"
[]
>
<WMS_DescribeLayerResponse version="1.1.0" >
<LayerDescription name="rivers" owsType="WFS"
owsURL="http://localhost/cgi-bin/mapserv.exe?map=c:/ms4w/apps/mum2_ogc_workshop/service/config.map">
<Query typeName="rivers" />
</LayerDescription>
</WMS_DescribeLayerResponse>

...which would give parsers a more uniform response where they can test for
values rather than existence of attributes.

Change History (5)

comment:1 by dmorissette, 20 years ago

Milestone: 4.4 release

comment:2 by tomkralidis, 20 years ago

Here's a code snippet change I made to make this happen:

file: mapwms.c
function: msWMSDescribeLayer


         if (pszOnlineResLyr && (lp->type == MS_LAYER_POINT ||
                                   lp->type == MS_LAYER_LINE ||
                                   lp->type == MS_LAYER_POLYGON ) )
           {
             char *pszOnlineResEncoded;
             pszOnlineResEncoded = msEncodeHTMLEntities(pszOnlineResLyr);

             printf("<LayerDescription name=\"%s\" owsType=\"WFS\"
owsURL=\"%s\">\n",
                    lp->name, pszOnlineResEncoded);
             printf("<Query typeName=\"%s\" />\n", lp->name);
             printf("</LayerDescription>\n");

             msFree(pszOnlineResEncoded);
           }

           else if (pszOnlineResLyr && (lp->type == MS_LAYER_RASTER))
           {
             char *pszOnlineResEncoded;
             pszOnlineResEncoded = msEncodeHTMLEntities(pszOnlineResLyr);

             printf("<LayerDescription name=\"%s\" owsType=\"WCS\"
owsURL=\"%s\">\n",
                    lp->name, pszOnlineResEncoded);
             printf("<Query typeName=\"%s\" />\n", lp->name);
             printf("</LayerDescription>\n");

             msFree(pszOnlineResEncoded);
           }

           else
           {
             printf("<LayerDescription name=\"%s\"></LayerDescription>\n",
                    lp->name);
           }

comment:3 by assefa, 20 years ago

XML now validate.

I kept the wfs url in case applications were already using it.

added the owsType/owsURL : I have only done this for WFS.

I have not added the WCS : should I add it ? Not sure what the status is but I 
think it is complete.  If we add it do we use wcs_onlineresource as a metada 
for rastser layers ?

comment:4 by tomkralidis, 20 years ago

You, we should add WCS i.e. owsType="WCS" owsURL="[ows_onlineresource]" or
"wcs_onlineresource"

comment:5 by assefa, 20 years ago

Resolution: fixed
Status: newclosed
WCS added. Making it as Fixed.
Note: See TracTickets for help on using tickets.