Bug 364 - WMS client does not use required styles parameter
: WMS client does not use required styles parameter
Status: CLOSED FIXED
: Chameleon
Core
: 1.1
: PC Windows 2000
: P2 normal
: 1.99 beta 2
Assigned To:
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2004-04-23 09:20 by
Modified: 2004-07-14 15:06 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2004-04-23 09:20:03
When adding a layer from a WMS server Chameleon does not use the required STYLES
parameter. This causes the new ESRI WMS connector to not work with Chameleon.
Please let me know if this should be posted in Mapserver bugzilla.

I use the following workaround: use ?styles=& in the WMS URL:
http://192.168.3.107:8080/wmsconnector/com.esri.wsit.WMSServlet/provincies?styles=&

From the OGC spec:
STYLES=style_list	R	Comma-separated list of one rendering style per requested
layer. Optional if SLD parameter is present.
------- Comment #1 From 2004-04-23 09:35:05 -------
Bart I am curious as to which version of WMS this is in?  I believe this issue
should be fixed in the mapserver WMS client (i.e. it should ensure that styles=
is in the URL if it is mandatory)
------- Comment #2 From 2004-04-23 10:09:45 -------
Hi Paul,

I just upgraded to the Mapserver 4.2 beta binaries from maptools.org and 
changed my chameleon cwc2.xml config to php_mapscript_42.dll and the problem is 
still there.

Bart
------- Comment #3 From 2004-04-23 14:00:04 -------
Mapserver should include the STYLES= parameter in the URL, so it's either that
something is missing or set wrong by chameleon, or there is a bug in MapServer's
handling of the styles parameter.

The URL you provided is probably on your lan, and we don't have access to
ArcIMS...could you attach the mapfile, or a context file that I could load in
MapServer to try to reproduce?

Also, can you please specify how you added the layer to the mapfile?  Did you
add it by hand, or did you do it via a chameleon widget?
------- Comment #4 From 2004-04-23 14:21:34 -------
Hi Daniel,

this is the URL which is built (I got it from the Apache error log when stopping 
Tomcat on my machine, you're right that it is a machine in the local network 
only):
http://192.168.3.107:8080/wmsconnector/com.esri.wsit.WMSServlet/provincies?
SERVICE=WMS&VERSION=1.1.
1&LAYERS=laag0&QUERY_LAYERS=laag0&FORMAT=image/png&TRANSPARENT=TRUE&REQUEST=GetM
ap&WIDTH=800&HEIGHT=560&SRS=EPSG:28992&BBOX=-79713.955357,285935.714286,368593.
187500,599935.714286&EXCEPTIONS=application/vnd.ogc.se_inimage

What I do in Chameleon is the following:
1) I added a WMS server through the Manage Server widget
2) I added a layer from this WMS through the treeview widget

The treeview is a copy of browseData.php from Chameleon and uses the  
addWMSLayer function.

You can see it in action at:

http://www.vz.geodan.nl:1111/geoservices05/

Press the first button which gets the treeview (the service is called 
ArcIMS@Bart, it has only got one layer).

Add the layer by pressing the hyperlink.
------- Comment #5 From 2004-04-23 14:25:42 -------
I forgot to mention, this is what is written in the session MAP file:

  LAYER
    CONNECTION "http://192.168.3.107:8080/wmsconnector/com.esri.wsit.
WMSServlet/provincies?SERVICE=WMS&VERSION=1.1.
1&LAYERS=laag0&QUERY_LAYERS=laag0&FORMAT=image/png&TRANSPARENT=TRUE"
    CONNECTIONTYPE WMS
    DUMP TRUE
      METADATA
        "wms_extractable"	"0"
        "wms_srs"	"EPSG:28992 EPSG:4326 EPSG:4267 EPSG:4269 EPSG:26703 EPSG:
26704 EPSG:26705 EPSG:26706 EPSG:26707 EPSG:26708 EPSG:26709 EPSG:26710 EPSG:
26711 EPSG:26712 EPSG:26713 EPSG:26714 EPSG:26715 EPSG:26716 EPSG:26717 EPSG:
26718 EPSG:26719 EPSG:26720 EPSG:26721 EPSG:26722 EPSG:26903 EPSG:26904 EPSG:
26905 EPSG:26906 EPSG:26907 EPSG:26908 EPSG:26909 EPSG:26910 EPSG:26911 EPSG:
26912 EPSG:26913 EPSG:26914 EPSG:26915 EPSG:26916 EPSG:26917 EPSG:26918 EPSG:
26919 EPSG:26920 EPSG:26921 EPSG:26922 EPSG:26923 EPSG:26930 EPSG:26986 EPSG:
26987 EPSG:27582 EPSG:27700 EPSG:32118 EPSG:32128 EPSG:32129 EPSG:32601 EPSG:
32602 EPSG:32603 EPSG:32604 EPSG:32605 EPSG:32606 EPSG:32607 EPSG:32608 EPSG:
32609 EPSG:32610 EPSG:32611 EPSG:32612 EPSG:32613 EPSG:32614 EPSG:32615 EPSG:
32616 EPSG:32617 EPSG:32618 EPSG:32619 EPSG:32620 EPSG:32621 EPSG:32622 EPSG:
32623 EPSG:32624 EPSG:32625 EPSG:32626 EPSG:32627 EPSG:32628 EPSG:32629 EPSG:
32630 EPSG:32631 EPSG:32632 EPSG:32633 EPSG:32634 EPSG:32635 EPSG:32636 EPSG:
32637 EPSG:32638 EPSG:32639 EPSG:32640 EPSG:32641 EPSG:32642 EPSG:32643 EPSG:
32644 EPSG:32645 EPSG:32646 EPSG:32647 EPSG:32648 EPSG:32649 EPSG:32650 EPSG:
32651 EPSG:32652 EPSG:32653 EPSG:32654 EPSG:32655 EPSG:32656 EPSG:32657 EPSG:
32658 EPSG:32659 EPSG:32660 EPSG:32701 EPSG:32702 EPSG:32703 EPSG:32704 EPSG:
32705 EPSG:32706 EPSG:32707 EPSG:32708 EPSG:32709 EPSG:32710 EPSG:32711 EPSG:
32712 EPSG:32713 EPSG:32714 EPSG:32715 EPSG:32716 EPSG:32717 EPSG:32718 EPSG:
32719 EPSG:32720 EPSG:32721 EPSG:32722 EPSG:32723 EPSG:32724 EPSG:32725 EPSG:
32726 EPSG:32727 EPSG:32728 EPSG:32729 EPSG:32730 EPSG:32731 EPSG:32732 EPSG:
32733 EPSG:32734 EPSG:32735 EPSG:32736 EPSG:32737 EPSG:32738 EPSG:32739 EPSG:
32740 EPSG:32741 EPSG:32742 EPSG:32743 EPSG:32744 EPSG:32745 EPSG:32746 EPSG:
32747 EPSG:32748 EPSG:32749 EPSG:32750 EPSG:32751 EPSG:32752 EPSG:32753 EPSG:
32754 EPSG:32755 EPSG:32756 EPSG:32757 EPSG:32758 EPSG:32759 EPSG:32760 EPSG:
41002 EPSG:42101 EPSG:42102 EPSG:42103 EPSG:42104 EPSG:42105 EPSG:42200 EPSG:
42201 EPSG:42202 EPSG:42203 EPSG:42204 EPSG:42205 EPSG:42206 EPSG:42207 EPSG:
42208 EPSG:100001 EPSG:42301 EPSG:42302 EPSG:42303 EPSG:42304 EPSG:42305"
        "wms_onlineresource"	"http://192.168.3.107:8080/wmsconnector/com.
esri.wsit.WMSServlet/provincies?"
        "wms_stylelist"	""
        "wms_name"	"laag0"
        "wms_title"	"NLPR_R98"
        "wms_abstract"	""
        "wms_server_version"	"1.1.1"
        "wms_formatlist"	"image/png,image/jpeg,"
        "wms_format"	"image/png"
        "wms_boundingbox"	"-180 -90 180 90"
      END
    NAME "laag0"
    PROJECTION
      "init=epsg:28992"
    END
    SIZEUNITS PIXELS
    STATUS ON
    TEMPLATE "blank.html"
    TOLERANCE 0
    TOLERANCEUNITS PIXELS
    TYPE RASTER
    UNITS METERS
  END
------- Comment #6 From 2004-04-23 15:25:58 -------
The problem is in the WMSBrowser widget file.  It builds the connection in the
map file in the wrong way.  WMSBrowser creates all the necessary metadata for
MapServer to generate a correct URL but MapServer will not generate a correct
URL unless the connection does not include several keys (like version for instance).

The fix is to edit WMSBrowser.widget.php lines 581+ that look like this:
        // build connection string
        $szConnection = $szURL.$szQuestionMark;
        ."SERVICE=WMS&VERSION=".$szWMSVersion
        ."&LAYERS=".urlencode( trim( $axCapRec['name'] ) )
        .$szQueryLayers
        ."&FORMAT=".$szFormat."&TRANSPARENT=TRUE";
        
and replace with:

        // build connection string
        $szConnection = $szURL.$szQuestionMark;
        /*
         * this is not required, it should be built from metadata.
        ."SERVICE=WMS&VERSION=".$szWMSVersion
        ."&LAYERS=".urlencode( trim( $axCapRec['name'] ) )
        .$szQueryLayers
        ."&FORMAT=".$szFormat."&TRANSPARENT=TRUE";
        */

Note that this is untested since I am in the middle of modifying everything in
cvs.  Bart, please try this and let me know if it works, and I will incorporate
the change in cvs.
------- Comment #7 From 2004-04-23 15:43:48 -------
Paul,

you're right. I tested this change in the version of the code we use (though not 
in WMSBrowser but in the browsedata.php file) and just using the URL without the 
params for the CONNECTION works.

I will set the status to solved, but maybe there are some other parts of 
Chameleon which have the same piece of code?
------- Comment #8 From 2004-06-24 10:05:53 -------
Paul, can you verify this bug, it seems in your redesign of Chameleon to 1.99
you commented out the suggested fix.....

        // build connection string
        $szConnection = $szURL.$szQuestionMark;
        /*
         * this is not required, it should be built from metadata.
        ."SERVICE=WMS&VERSION=".$szWMSVersion
        ."&LAYERS=".urlencode( trim( $axCapRec['name'] ) )
        .$szQueryLayers
        ."&FORMAT=".$szFormat."&TRANSPARENT=TRUE";
        */
        // only add the layer if format is set

Also, I am unable to verify since I do not have a client side ArcIMS WMS
Connector. Any suggestions?
------- Comment #9 From 2004-07-05 14:30:04 -------
Bart, please verify this bug.
------- Comment #10 From 2004-07-06 02:22:19 -------
Verified for WMSBrowser.

One thing though, there is one more occurrence of this in the source code, i.e.
CatalogSearch.widget.php.
------- Comment #11 From 2004-07-14 15:06:55 -------
Bart verified, will be closing this bug