Fix "formard" compatibility problem with the list of web-services in the client
authorSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Thu, 12 Sep 2013 08:33:25 +0000 (09:33 +0100)
committerSasha Sherstnev <a.sherstnev@dundee.ac.uk>
Thu, 12 Sep 2013 08:33:25 +0000 (09:33 +0100)
webservices/compbio/ws/client/Jws2Client.java
webservices/compbio/ws/client/Services.java

index 3c62c29..0991e0f 100644 (file)
@@ -232,8 +232,8 @@ public class Jws2Client {
                        throws WebServiceException, IOException {\r
                Set<Services> services = Jws2Client.getServices(hostname);\r
                if (!services.isEmpty()) {\r
-                       System.out.println("Supported services are: "\r
-                                       + Services.toString(services));\r
+                       System.out.println("There are " + services.size() + " available services at " + hostname + ":");\r
+                       System.out.print("The list of services:\n" + Services.toString(services));\r
                } else {\r
                        System.out.println("Failed to connect to the registry! ");\r
                }\r
index 2ffafb6..e5a937f 100644 (file)
@@ -58,14 +58,16 @@ public enum Services {
 \r
        public static String toString(Set<Services> services) {\r
                if (services == null || services.isEmpty()) {\r
-                       return "";\r
+                       return "No known services...\n";\r
                }\r
                String value = "";\r
-               String delim = ", ";\r
                for (Services serv : services) {\r
-                       value += serv.toString() + delim;\r
+                       if (null != serv) {\r
+                               value += serv + "\n";\r
+                       } else {\r
+                               value += "Unknown Service\n";\r
+                       }\r
                }\r
-               value = value.substring(0, value.length() - delim.length());\r
                return value;\r
        }\r
 \r