+\r
+ /**\r
+ * Asks registry to test the service on the host hostname\r
+ * \r
+ * @param hostname\r
+ * @param service\r
+ * @param writer\r
+ * @throws ConnectException\r
+ * @throws WebServiceException\r
+ */\r
+ public static void testService(String hostname, Services service,\r
+ PrintWriter writer) throws ConnectException, WebServiceException {\r
+ RegistryWS registry = connectToRegistry(hostname);\r
+ if (registry != null) {\r
+ String message = registry.testService(service);\r
+ writer.println("Service " + service + " testing results: ");\r
+ writer.println(message);\r
+ FileUtil.closeSilently(((Closeable) registry));\r
+ }\r
+ writer.flush();\r
+ }\r
+\r
+ public static Set<Services> getServices(String hostname)\r
+ throws WebServiceException, ConnectException {\r
+ RegistryWS registry = connectToRegistry(hostname);\r
+ Set<Services> services = Collections.EMPTY_SET;\r
+ if (registry != null) {\r
+ services = registry.getSupportedServices();\r
+ FileUtil.closeSilently(((Closeable) registry));\r
+ }\r
+ return services;\r
+ }\r
+\r
+ private static void listServices(String hostname)\r
+ 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
+ } else {\r
+ System.out.println("Failed to connect to the registry! ");\r
+ }\r
+ }\r
+\r