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
\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