private String editUrl(String initUrl, String title)
{
String url=initUrl;
- URL foo;
+ URL foo=null;
if (url==null)
{
url = "";
}
if (valid && resp==JOptionPane.OK_OPTION)
{
- return urltf.getText().trim();
+ int validate = JOptionPane.showInternalConfirmDialog(Desktop.desktop, null, "Validate JabaWS Server ?\n(Look in console output for results)", JOptionPane.YES_NO_OPTION);
+ if (validate == JOptionPane.OK_OPTION)
+ {
+ if (jalview.ws.jws2.Jws2Discoverer.testServiceUrl(foo))
+ {
+ return foo.toString();
+ }
+ }
}
return initUrl;
}
: new Vector<Jws2Instance>(services);
}
+ /**
+ * test the given URL with the JabaWS test code
+ * @param foo
+ * @return
+ */
+ public static boolean testServiceUrl(URL foo)
+ {
+ try {
+ compbio.ws.client.WSTester.main(new String[] { "-h="+foo.toString()});
+ } catch (Exception e)
+ {
+ return false;
+ }
+ catch (OutOfMemoryError e)
+ {
+ return false;
+ }
+ catch (Error e)
+ {
+ return false;
+ }
+ return true;
+ }
+
}