Index: /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/AddWMSLayerPanel.java
===================================================================
--- /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/AddWMSLayerPanel.java	(revision 22962)
+++ /applications/editors/josm/plugins/wmsplugin/src/wmsplugin/AddWMSLayerPanel.java	(revision 22963)
@@ -184,4 +184,10 @@
         a.append(serviceUrl.getPath());
         a.append("?");
+        if(serviceUrl.getQuery() != null) {
+            a.append(serviceUrl.getQuery());
+            if (!serviceUrl.getQuery().endsWith("&")) {
+                a.append("&");
+            }
+        }
         return a.toString();
     }
@@ -213,14 +219,15 @@
 
     private void attemptGetCapabilities(String serviceUrlStr) {
-        serviceUrl = null;
+        URL getCapabilitiesUrl = null;
         try {
             if (!serviceUrlStr.trim().contains("capabilities")) {
                 // If the url doesn't already have GetCapabilities, add it in
-                serviceUrl = new URL(serviceUrlStr + "VERSION=1.1.1&SERVICE=WMS&REQUEST=GetCapabilities");
+                getCapabilitiesUrl = new URL(serviceUrlStr + "VERSION=1.1.1&SERVICE=WMS&REQUEST=GetCapabilities");
             } else {
                 // Otherwise assume it's a good URL and let the subsequent error
                 // handling systems deal with problems
-                serviceUrl = new URL(serviceUrlStr);
-            }
+                getCapabilitiesUrl = new URL(serviceUrlStr);
+            }
+            serviceUrl = new URL(serviceUrlStr);
         } catch (HeadlessException e) {
             return;
@@ -231,9 +238,9 @@
         }
 
-        System.out.println("Connecting to: " + serviceUrl);
+        System.out.println("Connecting to: " + getCapabilitiesUrl);
 
         String incomingData;
         try {
-            URLConnection openConnection = serviceUrl.openConnection();
+            URLConnection openConnection = getCapabilitiesUrl.openConnection();
             InputStream inputStream = openConnection.getInputStream();
             BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
@@ -281,5 +288,5 @@
 
         try {
-            treeRootNode.setUserObject(serviceUrl.getHost());
+            treeRootNode.setUserObject(getCapabilitiesUrl.getHost());
             Element capabilityElem = getChild(document.getDocumentElement(), "Capability");
             List<Element> children = getChildren(capabilityElem, "Layer");
