From 45154567757138fa61f345bee3429246a98f1969 Mon Sep 17 00:00:00 2001 From: pvtroshin Date: Mon, 27 Jun 2011 16:40:37 +0000 Subject: [PATCH] Slight refactoring git-svn-id: link to svn.lifesci.dundee.ac.uk/svn/barton/ptroshin/JABA2@4342 e3abac25-378b-4346-85de-24260fe3988d --- testsrc/compbio/ws/client/TestAAConWS.java | 18 +++- testsrc/compbio/ws/client/WSTesterTester.java | 36 +++++-- webservices/compbio/data/msa/JABAService.java | 5 + webservices/compbio/data/msa/RegistryWS.java | 2 +- .../compbio/data/msa/SequenceAnnotation.java | 2 +- .../compbio/data/msa/jaxws/GetConservation.java | 36 ------- .../data/msa/jaxws/GetConservationResponse.java | 37 ------- webservices/compbio/ws/client/Jws2Client.java | 48 +++++---- webservices/compbio/ws/client/WSTester.java | 24 ++++- webservices/compbio/ws/server/AAConWS.java | 3 +- webservices/compbio/ws/server/ClustalWS.java | 3 +- webservices/compbio/ws/server/DisemblWS.java | 3 +- webservices/compbio/ws/server/GlobPlotWS.java | 3 +- webservices/compbio/ws/server/IUPredWS.java | 3 +- webservices/compbio/ws/server/JronnWS.java | 3 +- webservices/compbio/ws/server/MafftWS.java | 3 +- webservices/compbio/ws/server/MuscleWS.java | 3 +- webservices/compbio/ws/server/ProbconsWS.java | 3 +- webservices/compbio/ws/server/RegistryWS.java | 20 +++- webservices/compbio/ws/server/TcoffeeWS.java | 3 +- .../compbio/ws/server/resource/AAConWS.wsdl | 56 +++++------ .../compbio/ws/server/resource/AAConWS_schema1.xsd | 34 +++---- .../compbio/ws/server/resource/ClustalWS.wsdl | 56 +++++------ .../ws/server/resource/ClustalWS_schema1.xsd | 52 +++++----- .../compbio/ws/server/resource/DisemblWS.wsdl | 102 ++++++++++---------- .../ws/server/resource/DisemblWS_schema1.xsd | 34 +++---- .../compbio/ws/server/resource/GlobPlotWS.wsdl | 102 ++++++++++---------- .../ws/server/resource/GlobPlotWS_schema1.xsd | 34 +++---- .../compbio/ws/server/resource/IUPredWS.wsdl | 102 ++++++++++---------- .../ws/server/resource/IUPredWS_schema1.xsd | 62 ++++++------ .../compbio/ws/server/resource/JronnWS.wsdl | 102 ++++++++++---------- .../compbio/ws/server/resource/JronnWS_schema1.xsd | 34 +++---- .../compbio/ws/server/resource/MafftWS.wsdl | 56 +++++------ .../compbio/ws/server/resource/MafftWS_schema1.xsd | 52 +++++----- .../compbio/ws/server/resource/MuscleWS.wsdl | 56 +++++------ .../ws/server/resource/MuscleWS_schema1.xsd | 52 +++++----- .../compbio/ws/server/resource/RegistryWS.wsdl | 26 ++--- .../compbio/ws/server/resource/TcoffeeWS.wsdl | 56 +++++------ .../ws/server/resource/TcoffeeWS_schema1.xsd | 52 +++++----- 39 files changed, 700 insertions(+), 678 deletions(-) delete mode 100644 webservices/compbio/data/msa/jaxws/GetConservation.java delete mode 100644 webservices/compbio/data/msa/jaxws/GetConservationResponse.java diff --git a/testsrc/compbio/ws/client/TestAAConWS.java b/testsrc/compbio/ws/client/TestAAConWS.java index 68b5987..19cd0b2 100644 --- a/testsrc/compbio/ws/client/TestAAConWS.java +++ b/testsrc/compbio/ws/client/TestAAConWS.java @@ -8,8 +8,11 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; +import java.net.ConnectException; import java.util.List; +import javax.xml.ws.WebServiceException; + import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; @@ -45,10 +48,17 @@ public class TestAAConWS { * QName(namespace, "AAConWS"); Service serv = Service.create(url, * qname); msaws = serv.getPort(new QName(namespace, "AAConWSPort"), * Annotation.class); - */ - JABAService client = Jws2Client.connect("http://localhost:8080/jabaws", - Services.AAConWS); - msaws = (SequenceAnnotation) client; + */try { + JABAService client = Jws2Client.connect( + "http://localhost:8080/jabaws", Services.AAConWS); + msaws = (SequenceAnnotation) client; + } catch (ConnectException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (WebServiceException e) { + e.printStackTrace(); + fail(e.getMessage()); + } } @Test(groups = {AllTestSuit.test_group_webservices}) diff --git a/testsrc/compbio/ws/client/WSTesterTester.java b/testsrc/compbio/ws/client/WSTesterTester.java index 144c7b2..b8cf29d 100644 --- a/testsrc/compbio/ws/client/WSTesterTester.java +++ b/testsrc/compbio/ws/client/WSTesterTester.java @@ -1,8 +1,12 @@ package compbio.ws.client; import static org.testng.Assert.assertTrue; +import static org.testng.Assert.fail; import java.io.PrintWriter; +import java.net.ConnectException; + +import javax.xml.ws.WebServiceException; import org.testng.annotations.Test; @@ -12,15 +16,25 @@ public class WSTesterTester { public static final String SERVER = "http://localhost:8080/jabaws"; + // public static final String SERVER = + // "http://nanna.cluster.lifesci.dundee.ac.uk:8080/jaba"; + @Test(groups = {AllTestSuit.test_group_webservices}) public void testAllWindowsWS() { WSTester tester = new WSTester(SERVER, new PrintWriter(System.out, true)); - - assertTrue(tester.checkService(Services.AAConWS)); - assertTrue(tester.checkService(Services.JronnWS)); - assertTrue(tester.checkService(Services.ClustalWS)); - assertTrue(tester.checkService(Services.MuscleWS)); + try { + assertTrue(tester.checkService(Services.AAConWS)); + assertTrue(tester.checkService(Services.JronnWS)); + assertTrue(tester.checkService(Services.ClustalWS)); + assertTrue(tester.checkService(Services.MuscleWS)); + } catch (ConnectException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (WebServiceException e) { + e.printStackTrace(); + fail(e.getMessage()); + } // Will throw UnsupportedRuntimeException on windows // ws = Jws2Client.connect(SERVER, Services.MafftWS); @@ -31,8 +45,16 @@ public class WSTesterTester { @Test(groups = {AllTestSuit.test_group_webservices}) public void testAllWS() { WSTester tester = new WSTester(SERVER, new PrintWriter(System.out)); - for (Services service : Services.values()) { - assertTrue(tester.checkService(service)); + try { + for (Services service : Services.values()) { + assertTrue(tester.checkService(service)); + } + } catch (ConnectException e) { + e.printStackTrace(); + fail(e.getMessage()); + } catch (WebServiceException e) { + e.printStackTrace(); + fail(e.getMessage()); } } diff --git a/webservices/compbio/data/msa/JABAService.java b/webservices/compbio/data/msa/JABAService.java index 69d53f7..5f77d77 100644 --- a/webservices/compbio/data/msa/JABAService.java +++ b/webservices/compbio/data/msa/JABAService.java @@ -8,4 +8,9 @@ package compbio.data.msa; */ public interface JABAService { + // JABAWS version 1.0 service name + static final String SERVICE_NAMESPACE = "http://msa.data.compbio/01/01/2010/"; + // JABAWS version 2.0 service name + static final String V2_SERVICE_NAMESPACE = "http://msa.data.compbio/01/12/2010/"; + } diff --git a/webservices/compbio/data/msa/RegistryWS.java b/webservices/compbio/data/msa/RegistryWS.java index 9f55ff9..123546d 100644 --- a/webservices/compbio/data/msa/RegistryWS.java +++ b/webservices/compbio/data/msa/RegistryWS.java @@ -13,7 +13,7 @@ import compbio.ws.client.Services; * @author pvtroshin * @version 1.0 June 2011 */ -@WebService(targetNamespace = "http://msa.data.compbio/01/12/2010/") +@WebService(targetNamespace = JABAService.V2_SERVICE_NAMESPACE) public interface RegistryWS extends JABAService { /** diff --git a/webservices/compbio/data/msa/SequenceAnnotation.java b/webservices/compbio/data/msa/SequenceAnnotation.java index c52c030..2d9d729 100644 --- a/webservices/compbio/data/msa/SequenceAnnotation.java +++ b/webservices/compbio/data/msa/SequenceAnnotation.java @@ -29,7 +29,7 @@ import compbio.metadata.WrongParameterException; * * @version 1.0 November 2010 */ -@WebService(targetNamespace = "http://msa.data.compbio/01/12/2010/") +@WebService(targetNamespace = JABAService.V2_SERVICE_NAMESPACE) public interface SequenceAnnotation extends JABAService, diff --git a/webservices/compbio/data/msa/jaxws/GetConservation.java b/webservices/compbio/data/msa/jaxws/GetConservation.java deleted file mode 100644 index cc3ba51..0000000 --- a/webservices/compbio/data/msa/jaxws/GetConservation.java +++ /dev/null @@ -1,36 +0,0 @@ - -package compbio.data.msa.jaxws; - -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -@XmlRootElement(name = "getConservation", namespace = "http://msa.data.compbio/01/12/2010/") -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "getConservation", namespace = "http://msa.data.compbio/01/12/2010/") -public class GetConservation { - - @XmlElement(name = "jobId", namespace = "") - private String jobId; - - /** - * - * @return - * returns String - */ - public String getJobId() { - return this.jobId; - } - - /** - * - * @param jobId - * the value for the jobId property - */ - public void setJobId(String jobId) { - this.jobId = jobId; - } - -} diff --git a/webservices/compbio/data/msa/jaxws/GetConservationResponse.java b/webservices/compbio/data/msa/jaxws/GetConservationResponse.java deleted file mode 100644 index fe7fd58..0000000 --- a/webservices/compbio/data/msa/jaxws/GetConservationResponse.java +++ /dev/null @@ -1,37 +0,0 @@ - -package compbio.data.msa.jaxws; - -import java.util.HashSet; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlType; - -@XmlRootElement(name = "getConservationResponse", namespace = "http://msa.data.compbio/01/12/2010/") -@XmlAccessorType(XmlAccessType.FIELD) -@XmlType(name = "getConservationResponse", namespace = "http://msa.data.compbio/01/12/2010/") -public class GetConservationResponse { - - @XmlElement(name = "return", namespace = "") - private HashSet _return; - - /** - * - * @return - * returns HashSet - */ - public HashSet getReturn() { - return this._return; - } - - /** - * - * @param _return - * the value for the _return property - */ - public void setReturn(HashSet _return) { - this._return = _return; - } - -} diff --git a/webservices/compbio/ws/client/Jws2Client.java b/webservices/compbio/ws/client/Jws2Client.java index c18f100..e775727 100644 --- a/webservices/compbio/ws/client/Jws2Client.java +++ b/webservices/compbio/ws/client/Jws2Client.java @@ -28,6 +28,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.PrintWriter; import java.io.Writer; +import java.net.ConnectException; import java.net.MalformedURLException; import java.net.URL; import java.util.Arrays; @@ -71,12 +72,6 @@ public class Jws2Client { private static final Logger log = Logger.getLogger(Jws2Client.class .getCanonicalName()); - // JABAWS version 1.0 service name - static final String QUALIFIED_SERVICE_NAME = "http://msa.data.compbio/01/01/2010/"; - - // JABAWS version 2.0 service name - static final String V2_QUALIFIED_SERVICE_NAME = "http://msa.data.compbio/01/12/2010/"; - /** * Attempt to construct the URL object from the string * @@ -199,6 +194,7 @@ public class Jws2Client { log.fine("Disconnected successfully!"); } + // TODO make public? private void testService(String hostname, Services service) throws IOException { RegistryWS registry = connectToRegistry(hostname); @@ -210,6 +206,7 @@ public class Jws2Client { } } + // TODO make public? private void listServices(String hostname) throws IOException { RegistryWS registry = connectToRegistry(hostname); if (registry != null) { @@ -320,17 +317,22 @@ public class Jws2Client { return analize(fastalist, wsproxy, preset, customOptions); } /** - * Connects to a web service by the host and the service name + * Connects to a web service by the host and the service name web service + * type * - * @param T - * web service type * @param host + * the fully qualified name of JABAWS server including JABAWS + * context name e.g + * http://nanna.cluster.lifesci.dundee.ac.uk:8080/jaba * @param service - * @return MsaWS + * the name of the JABAWS service to connect to + * @return JABAService * @throws WebServiceException + * @throws ConnectException + * if fails to connect to the service on the host */ public static JABAService connect(String host, Services service) - throws WebServiceException { + throws WebServiceException, ConnectException { URL url = null; log.log(Level.FINE, "Attempting to connect..."); try { @@ -341,17 +343,17 @@ public class Jws2Client { } Service serv = null; try { - serv = service.getService(url, QUALIFIED_SERVICE_NAME); + serv = service.getService(url, JABAService.SERVICE_NAMESPACE); } catch (WebServiceException wse) { System.out.println("Connecting to JABAWS version 2 service"); if (isV2service(wse)) { - serv = service.getService(url, V2_QUALIFIED_SERVICE_NAME); + serv = service + .getService(url, JABAService.V2_SERVICE_NAMESPACE); } } if (serv == null) { - System.err.println("Could not connect to " + url + throw new ConnectException("Could not connect to " + url + " the server is down?"); - // FIXME } JABAService serviceIF = service.getInterface(serv); log.log(Level.INFO, "Connected successfully!"); @@ -363,13 +365,25 @@ public class Jws2Client { String message = wse.getMessage(); int idx = message.indexOf("not a valid service"); if (idx > 0) { - if (message.substring(idx).contains(V2_QUALIFIED_SERVICE_NAME)) { + if (message.substring(idx).contains( + JABAService.V2_SERVICE_NAMESPACE)) { return true; } } return false; } + /** + * Get a connection of JABAWS registry + * + * @param host + * the fully qualified name of JABAWS server including JABAWS + * context name e.g + * http://nanna.cluster.lifesci.dundee.ac.uk:8080/jaba + * @return compbio.data.msa.RegistryWS - instance of a RegistryWS web + * service + * @throws WebServiceException + */ public static compbio.data.msa.RegistryWS connectToRegistry(String host) throws WebServiceException { URL url = null; @@ -382,7 +396,7 @@ public class Jws2Client { e.printStackTrace(); // ignore as the host name is already verified } - QName qname = new QName(V2_QUALIFIED_SERVICE_NAME, service); + QName qname = new QName(JABAService.V2_SERVICE_NAMESPACE, service); Service serv = Service.create(url, qname); if (serv == null) { diff --git a/webservices/compbio/ws/client/WSTester.java b/webservices/compbio/ws/client/WSTester.java index 4f721fe..def8efe 100644 --- a/webservices/compbio/ws/client/WSTester.java +++ b/webservices/compbio/ws/client/WSTester.java @@ -26,9 +26,12 @@ import java.io.ByteArrayInputStream; import java.io.Closeable; import java.io.IOException; import java.io.PrintWriter; +import java.net.ConnectException; import java.util.Arrays; import java.util.List; +import javax.xml.ws.WebServiceException; + import org.apache.log4j.Logger; import compbio.data.msa.JABAService; @@ -116,6 +119,15 @@ public class WSTester { private final PrintWriter writer; private final String hostname; + /** + * Construct an instance of JABAWS tester + * + * @param hostname + * - fully qualified host and context name of JABAWS e.g. + * http://nanna.cluster.lifesci.dundee.ac.uk:8080/jaba + * @param writer + * a PrintWriter instance to writer test log to. + */ public WSTester(String hostname, PrintWriter writer) { if (Util.isEmpty(hostname)) { throw new NullPointerException("Hostname must be provided!"); @@ -403,7 +415,17 @@ public class WSTester { } - public boolean checkService(Services service) { + /** + * Test JABA web service + * + * @param service + * the service to test + * @return true if the service works as expected, false otherwise + * @throws WebServiceException + * @throws ConnectException + */ + public boolean checkService(Services service) throws ConnectException, + WebServiceException { JABAService ws = Jws2Client.connect(hostname, service); if (ws == null) { writer.println("Cannot estabilish the connection to host " diff --git a/webservices/compbio/ws/server/AAConWS.java b/webservices/compbio/ws/server/AAConWS.java index d9fd54f..1318beb 100644 --- a/webservices/compbio/ws/server/AAConWS.java +++ b/webservices/compbio/ws/server/AAConWS.java @@ -8,6 +8,7 @@ import javax.jws.WebService; import org.apache.log4j.Logger; +import compbio.data.msa.JABAService; import compbio.data.msa.SequenceAnnotation; import compbio.data.sequence.FastaSequence; import compbio.engine.Configurator; @@ -18,7 +19,7 @@ import compbio.metadata.LimitExceededException; import compbio.metadata.UnsupportedRuntimeException; import compbio.runner.conservation.AACon; -@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "AAConWS") +@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = JABAService.V2_SERVICE_NAMESPACE, serviceName = "AAConWS") public class AAConWS extends SequenceAnnotationService implements SequenceAnnotation { diff --git a/webservices/compbio/ws/server/ClustalWS.java b/webservices/compbio/ws/server/ClustalWS.java index 61944de..75683c3 100644 --- a/webservices/compbio/ws/server/ClustalWS.java +++ b/webservices/compbio/ws/server/ClustalWS.java @@ -25,6 +25,7 @@ import javax.jws.WebService; import org.apache.log4j.Logger; +import compbio.data.msa.JABAService; import compbio.data.msa.MsaWS; import compbio.data.sequence.Alignment; import compbio.data.sequence.FastaSequence; @@ -46,7 +47,7 @@ import compbio.metadata.WrongParameterException; import compbio.runner.Util; import compbio.runner.msa.ClustalW; -@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = "http://msa.data.compbio/01/01/2010/", serviceName = "ClustalWS") +@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "ClustalWS") public class ClustalWS implements MsaWS { private static Logger log = Logger.getLogger(ClustalWS.class); diff --git a/webservices/compbio/ws/server/DisemblWS.java b/webservices/compbio/ws/server/DisemblWS.java index f609143..5410879 100644 --- a/webservices/compbio/ws/server/DisemblWS.java +++ b/webservices/compbio/ws/server/DisemblWS.java @@ -6,6 +6,7 @@ import javax.jws.WebService; import org.apache.log4j.Logger; +import compbio.data.msa.JABAService; import compbio.data.msa.SequenceAnnotation; import compbio.data.sequence.FastaSequence; import compbio.metadata.JobSubmissionException; @@ -16,7 +17,7 @@ import compbio.metadata.UnsupportedRuntimeException; import compbio.metadata.WrongParameterException; import compbio.runner.disorder.Disembl; -@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "DisemblWS") +@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = JABAService.V2_SERVICE_NAMESPACE, serviceName = "DisemblWS") public class DisemblWS extends SequenceAnnotationService implements SequenceAnnotation { diff --git a/webservices/compbio/ws/server/GlobPlotWS.java b/webservices/compbio/ws/server/GlobPlotWS.java index 5ed6331..bfbecb7 100644 --- a/webservices/compbio/ws/server/GlobPlotWS.java +++ b/webservices/compbio/ws/server/GlobPlotWS.java @@ -6,6 +6,7 @@ import javax.jws.WebService; import org.apache.log4j.Logger; +import compbio.data.msa.JABAService; import compbio.data.msa.SequenceAnnotation; import compbio.data.sequence.FastaSequence; import compbio.metadata.JobSubmissionException; @@ -16,7 +17,7 @@ import compbio.metadata.UnsupportedRuntimeException; import compbio.metadata.WrongParameterException; import compbio.runner.disorder.GlobPlot; -@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "GlobPlotWS") +@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = JABAService.V2_SERVICE_NAMESPACE, serviceName = "GlobPlotWS") public class GlobPlotWS extends SequenceAnnotationService implements SequenceAnnotation { diff --git a/webservices/compbio/ws/server/IUPredWS.java b/webservices/compbio/ws/server/IUPredWS.java index bcc5faa..58ab01e 100644 --- a/webservices/compbio/ws/server/IUPredWS.java +++ b/webservices/compbio/ws/server/IUPredWS.java @@ -6,6 +6,7 @@ import javax.jws.WebService; import org.apache.log4j.Logger; +import compbio.data.msa.JABAService; import compbio.data.msa.SequenceAnnotation; import compbio.data.sequence.FastaSequence; import compbio.metadata.JobSubmissionException; @@ -15,7 +16,7 @@ import compbio.metadata.UnsupportedRuntimeException; import compbio.metadata.WrongParameterException; import compbio.runner.disorder.IUPred; -@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "IUPredWS") +@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = JABAService.V2_SERVICE_NAMESPACE, serviceName = "IUPredWS") public class IUPredWS extends SequenceAnnotationService implements SequenceAnnotation { diff --git a/webservices/compbio/ws/server/JronnWS.java b/webservices/compbio/ws/server/JronnWS.java index c3fe1f4..3dd493e 100644 --- a/webservices/compbio/ws/server/JronnWS.java +++ b/webservices/compbio/ws/server/JronnWS.java @@ -6,13 +6,14 @@ import javax.jws.WebService; import org.apache.log4j.Logger; +import compbio.data.msa.JABAService; import compbio.data.msa.SequenceAnnotation; import compbio.engine.Configurator; import compbio.metadata.ChunkHolder; import compbio.runner.conservation.AACon; import compbio.runner.disorder.Jronn; -@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "JronnWS") +@WebService(endpointInterface = "compbio.data.msa.SequenceAnnotation", targetNamespace = JABAService.V2_SERVICE_NAMESPACE, serviceName = "JronnWS") public class JronnWS extends SequenceAnnotationService implements SequenceAnnotation { diff --git a/webservices/compbio/ws/server/MafftWS.java b/webservices/compbio/ws/server/MafftWS.java index 12805af..6a0d39e 100644 --- a/webservices/compbio/ws/server/MafftWS.java +++ b/webservices/compbio/ws/server/MafftWS.java @@ -25,6 +25,7 @@ import javax.jws.WebService; import org.apache.log4j.Logger; +import compbio.data.msa.JABAService; import compbio.data.msa.MsaWS; import compbio.data.sequence.Alignment; import compbio.data.sequence.FastaSequence; @@ -46,7 +47,7 @@ import compbio.metadata.WrongParameterException; import compbio.runner.Util; import compbio.runner.msa.Mafft; -@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = "http://msa.data.compbio/01/01/2010/", serviceName = "MafftWS") +@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "MafftWS") public class MafftWS implements MsaWS { private static Logger log = Logger.getLogger(MafftWS.class); diff --git a/webservices/compbio/ws/server/MuscleWS.java b/webservices/compbio/ws/server/MuscleWS.java index 0e5d3ef..fa9bdbc 100644 --- a/webservices/compbio/ws/server/MuscleWS.java +++ b/webservices/compbio/ws/server/MuscleWS.java @@ -25,6 +25,7 @@ import javax.jws.WebService; import org.apache.log4j.Logger; +import compbio.data.msa.JABAService; import compbio.data.msa.MsaWS; import compbio.data.sequence.Alignment; import compbio.data.sequence.FastaSequence; @@ -46,7 +47,7 @@ import compbio.metadata.WrongParameterException; import compbio.runner.Util; import compbio.runner.msa.Muscle; -@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = "http://msa.data.compbio/01/01/2010/", serviceName = "MuscleWS") +@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "MuscleWS") public class MuscleWS implements MsaWS { private static Logger log = Logger.getLogger(MuscleWS.class); diff --git a/webservices/compbio/ws/server/ProbconsWS.java b/webservices/compbio/ws/server/ProbconsWS.java index 4ab7a34..5b93355 100644 --- a/webservices/compbio/ws/server/ProbconsWS.java +++ b/webservices/compbio/ws/server/ProbconsWS.java @@ -25,6 +25,7 @@ import javax.jws.WebService; import org.apache.log4j.Logger; +import compbio.data.msa.JABAService; import compbio.data.msa.MsaWS; import compbio.data.sequence.Alignment; import compbio.data.sequence.FastaSequence; @@ -46,7 +47,7 @@ import compbio.metadata.WrongParameterException; import compbio.runner.Util; import compbio.runner.msa.Probcons; -@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = "http://msa.data.compbio/01/01/2010/", serviceName = "ProbconsWS") +@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "ProbconsWS") public class ProbconsWS implements MsaWS { private static Logger log = Logger.getLogger(ProbconsWS.class); diff --git a/webservices/compbio/ws/server/RegistryWS.java b/webservices/compbio/ws/server/RegistryWS.java index 0ff4294..ae56e5b 100644 --- a/webservices/compbio/ws/server/RegistryWS.java +++ b/webservices/compbio/ws/server/RegistryWS.java @@ -26,7 +26,7 @@ import compbio.ws.client.WSTester; * @author pvtroshin * */ -@WebService(endpointInterface = "compbio.data.msa.RegistryWS", targetNamespace = "http://msa.data.compbio/01/12/2010/", serviceName = "RegistryWS") +@WebService(endpointInterface = "compbio.data.msa.RegistryWS", targetNamespace = JABAService.V2_SERVICE_NAMESPACE, serviceName = "RegistryWS") public class RegistryWS implements compbio.data.msa.RegistryWS, JABAService { // Ask for resource injection @@ -123,8 +123,16 @@ public class RegistryWS implements compbio.data.msa.RegistryWS, JABAService { // the server synchronized (operating) { for (Services service : Services.values()) { - if (tester.checkService(service)) { - operating.put(service, new Date()); + try { + if (tester.checkService(service)) { + operating.put(service, new Date()); + } + } catch (Exception e) { + log.info(e, e.getCause()); + writer.println("Fails to connect to a web service: " + + service + " With " + e.getLocalizedMessage() + + "\nDetails: "); + e.printStackTrace(writer); } } } @@ -156,12 +164,16 @@ public class RegistryWS implements compbio.data.msa.RegistryWS, JABAService { operating.put(service, new Date()); } } + } catch (Exception e) { + log.info(e, e.getCause()); + writer.println("Fails to connect to a web service: " + service + + " With " + e.getLocalizedMessage() + "\nDetails: "); + e.printStackTrace(writer); } finally { writer.close(); } return testlog.toString(); } - @Override public boolean isOperating(Services service) { init(); diff --git a/webservices/compbio/ws/server/TcoffeeWS.java b/webservices/compbio/ws/server/TcoffeeWS.java index 59b4c19..3083b11 100644 --- a/webservices/compbio/ws/server/TcoffeeWS.java +++ b/webservices/compbio/ws/server/TcoffeeWS.java @@ -25,6 +25,7 @@ import javax.jws.WebService; import org.apache.log4j.Logger; +import compbio.data.msa.JABAService; import compbio.data.msa.MsaWS; import compbio.data.sequence.Alignment; import compbio.data.sequence.FastaSequence; @@ -47,7 +48,7 @@ import compbio.metadata.WrongParameterException; import compbio.runner.Util; import compbio.runner.msa.Tcoffee; -@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = "http://msa.data.compbio/01/01/2010/", serviceName = "TcoffeeWS") +@WebService(endpointInterface = "compbio.data.msa.MsaWS", targetNamespace = JABAService.SERVICE_NAMESPACE, serviceName = "TcoffeeWS") public class TcoffeeWS implements MsaWS { private static Logger log = Logger.getLogger(TcoffeeWS.class); diff --git a/webservices/compbio/ws/server/resource/AAConWS.wsdl b/webservices/compbio/ws/server/resource/AAConWS.wsdl index 8ff9829..772fca7 100644 --- a/webservices/compbio/ws/server/resource/AAConWS.wsdl +++ b/webservices/compbio/ws/server/resource/AAConWS.wsdl @@ -45,18 +45,18 @@ - - - - - - + + + + + + @@ -69,11 +69,11 @@ - - + + - - + + @@ -81,11 +81,11 @@ - - + + - - + + @@ -116,14 +116,14 @@ - - - - + + + + @@ -132,17 +132,17 @@ - - - + + + - - - + + + @@ -219,7 +219,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -273,7 +273,7 @@ - + diff --git a/webservices/compbio/ws/server/resource/AAConWS_schema1.xsd b/webservices/compbio/ws/server/resource/AAConWS_schema1.xsd index 99b9b4d..6f34ece 100644 --- a/webservices/compbio/ws/server/resource/AAConWS_schema1.xsd +++ b/webservices/compbio/ws/server/resource/AAConWS_schema1.xsd @@ -255,6 +255,23 @@ + + + + + + + + + + + + + + + + + @@ -281,23 +298,6 @@ - - - - - - - - - - - - - - - - - diff --git a/webservices/compbio/ws/server/resource/ClustalWS.wsdl b/webservices/compbio/ws/server/resource/ClustalWS.wsdl index d317bac..7ea9514 100644 --- a/webservices/compbio/ws/server/resource/ClustalWS.wsdl +++ b/webservices/compbio/ws/server/resource/ClustalWS.wsdl @@ -45,18 +45,18 @@ - - - - - - + + + + + + @@ -69,11 +69,11 @@ - - + + - - + + @@ -81,11 +81,11 @@ - - + + - - + + @@ -116,14 +116,14 @@ - - - - + + + + @@ -132,17 +132,17 @@ - - - + + + - - - + + + @@ -219,7 +219,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -273,7 +273,7 @@ - + diff --git a/webservices/compbio/ws/server/resource/ClustalWS_schema1.xsd b/webservices/compbio/ws/server/resource/ClustalWS_schema1.xsd index 05f2a89..c432550 100644 --- a/webservices/compbio/ws/server/resource/ClustalWS_schema1.xsd +++ b/webservices/compbio/ws/server/resource/ClustalWS_schema1.xsd @@ -161,32 +161,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -218,6 +192,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webservices/compbio/ws/server/resource/DisemblWS.wsdl b/webservices/compbio/ws/server/resource/DisemblWS.wsdl index 324f199..ad062c4 100644 --- a/webservices/compbio/ws/server/resource/DisemblWS.wsdl +++ b/webservices/compbio/ws/server/resource/DisemblWS.wsdl @@ -24,18 +24,18 @@ - - - - - - + + + + + + @@ -51,29 +51,17 @@ - - - - - - - - - - - - - - + + - - + + @@ -87,6 +75,18 @@ + + + + + + + + + + + + @@ -96,6 +96,13 @@ + + + + + + + @@ -104,13 +111,6 @@ - - - - - - - @@ -120,21 +120,13 @@ - - - - - - - - - - - + + + @@ -144,6 +136,14 @@ + + + + + + + + @@ -168,7 +168,7 @@ - + @@ -185,11 +185,8 @@ - - - - + @@ -206,6 +203,9 @@ + + + @@ -228,7 +228,7 @@ - + @@ -237,7 +237,7 @@ - + @@ -246,7 +246,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -264,7 +264,7 @@ - + @@ -273,7 +273,7 @@ - + diff --git a/webservices/compbio/ws/server/resource/DisemblWS_schema1.xsd b/webservices/compbio/ws/server/resource/DisemblWS_schema1.xsd index 321cfdd..a03987f 100644 --- a/webservices/compbio/ws/server/resource/DisemblWS_schema1.xsd +++ b/webservices/compbio/ws/server/resource/DisemblWS_schema1.xsd @@ -262,6 +262,23 @@ + + + + + + + + + + + + + + + + + @@ -300,23 +317,6 @@ - - - - - - - - - - - - - - - - - diff --git a/webservices/compbio/ws/server/resource/GlobPlotWS.wsdl b/webservices/compbio/ws/server/resource/GlobPlotWS.wsdl index 9577bb8..67f9169 100644 --- a/webservices/compbio/ws/server/resource/GlobPlotWS.wsdl +++ b/webservices/compbio/ws/server/resource/GlobPlotWS.wsdl @@ -24,18 +24,18 @@ - - - - - - + + + + + + @@ -51,29 +51,17 @@ - - - - - - - - - - - - - - + + - - + + @@ -87,6 +75,18 @@ + + + + + + + + + + + + @@ -96,6 +96,13 @@ + + + + + + + @@ -104,13 +111,6 @@ - - - - - - - @@ -120,21 +120,13 @@ - - - - - - - - - - - + + + @@ -144,6 +136,14 @@ + + + + + + + + @@ -168,7 +168,7 @@ - + @@ -185,11 +185,8 @@ - - - - + @@ -206,6 +203,9 @@ + + + @@ -228,7 +228,7 @@ - + @@ -237,7 +237,7 @@ - + @@ -246,7 +246,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -264,7 +264,7 @@ - + @@ -273,7 +273,7 @@ - + diff --git a/webservices/compbio/ws/server/resource/GlobPlotWS_schema1.xsd b/webservices/compbio/ws/server/resource/GlobPlotWS_schema1.xsd index 72ac6ff..d44ec86 100644 --- a/webservices/compbio/ws/server/resource/GlobPlotWS_schema1.xsd +++ b/webservices/compbio/ws/server/resource/GlobPlotWS_schema1.xsd @@ -275,6 +275,23 @@ + + + + + + + + + + + + + + + + + @@ -313,23 +330,6 @@ - - - - - - - - - - - - - - - - - diff --git a/webservices/compbio/ws/server/resource/IUPredWS.wsdl b/webservices/compbio/ws/server/resource/IUPredWS.wsdl index f10eb02..4627adb 100644 --- a/webservices/compbio/ws/server/resource/IUPredWS.wsdl +++ b/webservices/compbio/ws/server/resource/IUPredWS.wsdl @@ -24,18 +24,18 @@ - - - - - - + + + + + + @@ -51,29 +51,17 @@ - - - - - - - - - - - - - - + + - - + + @@ -87,6 +75,18 @@ + + + + + + + + + + + + @@ -96,6 +96,13 @@ + + + + + + + @@ -104,13 +111,6 @@ - - - - - - - @@ -120,21 +120,13 @@ - - - - - - - - - - - + + + @@ -144,6 +136,14 @@ + + + + + + + + @@ -168,7 +168,7 @@ - + @@ -185,11 +185,8 @@ - - - - + @@ -206,6 +203,9 @@ + + + @@ -228,7 +228,7 @@ - + @@ -237,7 +237,7 @@ - + @@ -246,7 +246,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -264,7 +264,7 @@ - + @@ -273,7 +273,7 @@ - + diff --git a/webservices/compbio/ws/server/resource/IUPredWS_schema1.xsd b/webservices/compbio/ws/server/resource/IUPredWS_schema1.xsd index 9c46d87..73e9d98 100644 --- a/webservices/compbio/ws/server/resource/IUPredWS_schema1.xsd +++ b/webservices/compbio/ws/server/resource/IUPredWS_schema1.xsd @@ -248,6 +248,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -286,37 +317,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/webservices/compbio/ws/server/resource/JronnWS.wsdl b/webservices/compbio/ws/server/resource/JronnWS.wsdl index baca048..f8caa2c 100644 --- a/webservices/compbio/ws/server/resource/JronnWS.wsdl +++ b/webservices/compbio/ws/server/resource/JronnWS.wsdl @@ -24,18 +24,18 @@ - - - - - - + + + + + + @@ -51,29 +51,17 @@ - - - - - - - - - - - - - - + + - - + + @@ -87,6 +75,18 @@ + + + + + + + + + + + + @@ -96,6 +96,13 @@ + + + + + + + @@ -104,13 +111,6 @@ - - - - - - - @@ -120,21 +120,13 @@ - - - - - - - - - - - + + + @@ -144,6 +136,14 @@ + + + + + + + + @@ -168,7 +168,7 @@ - + @@ -185,11 +185,8 @@ - - - - + @@ -206,6 +203,9 @@ + + + @@ -228,7 +228,7 @@ - + @@ -237,7 +237,7 @@ - + @@ -246,7 +246,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -264,7 +264,7 @@ - + @@ -273,7 +273,7 @@ - + diff --git a/webservices/compbio/ws/server/resource/JronnWS_schema1.xsd b/webservices/compbio/ws/server/resource/JronnWS_schema1.xsd index 1da2262..6f34ece 100644 --- a/webservices/compbio/ws/server/resource/JronnWS_schema1.xsd +++ b/webservices/compbio/ws/server/resource/JronnWS_schema1.xsd @@ -255,6 +255,23 @@ + + + + + + + + + + + + + + + + + @@ -293,23 +310,6 @@ - - - - - - - - - - - - - - - - - diff --git a/webservices/compbio/ws/server/resource/MafftWS.wsdl b/webservices/compbio/ws/server/resource/MafftWS.wsdl index c7bfe2e..c4fcf1c 100644 --- a/webservices/compbio/ws/server/resource/MafftWS.wsdl +++ b/webservices/compbio/ws/server/resource/MafftWS.wsdl @@ -45,18 +45,18 @@ - - - - - - + + + + + + @@ -69,11 +69,11 @@ - - + + - - + + @@ -81,11 +81,11 @@ - - + + - - + + @@ -116,14 +116,14 @@ - - - - + + + + @@ -132,17 +132,17 @@ - - - + + + - - - + + + @@ -219,7 +219,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -273,7 +273,7 @@ - + diff --git a/webservices/compbio/ws/server/resource/MafftWS_schema1.xsd b/webservices/compbio/ws/server/resource/MafftWS_schema1.xsd index 05f2a89..c432550 100644 --- a/webservices/compbio/ws/server/resource/MafftWS_schema1.xsd +++ b/webservices/compbio/ws/server/resource/MafftWS_schema1.xsd @@ -161,32 +161,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -218,6 +192,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webservices/compbio/ws/server/resource/MuscleWS.wsdl b/webservices/compbio/ws/server/resource/MuscleWS.wsdl index 867020c..da4ed97 100644 --- a/webservices/compbio/ws/server/resource/MuscleWS.wsdl +++ b/webservices/compbio/ws/server/resource/MuscleWS.wsdl @@ -45,18 +45,18 @@ - - - - - - + + + + + + @@ -69,11 +69,11 @@ - - + + - - + + @@ -81,11 +81,11 @@ - - + + - - + + @@ -116,14 +116,14 @@ - - - - + + + + @@ -132,17 +132,17 @@ - - - + + + - - - + + + @@ -219,7 +219,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -273,7 +273,7 @@ - + diff --git a/webservices/compbio/ws/server/resource/MuscleWS_schema1.xsd b/webservices/compbio/ws/server/resource/MuscleWS_schema1.xsd index e6c3574..0895916 100644 --- a/webservices/compbio/ws/server/resource/MuscleWS_schema1.xsd +++ b/webservices/compbio/ws/server/resource/MuscleWS_schema1.xsd @@ -152,32 +152,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -209,6 +183,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/webservices/compbio/ws/server/resource/RegistryWS.wsdl b/webservices/compbio/ws/server/resource/RegistryWS.wsdl index 8d7ec01..6760f66 100644 --- a/webservices/compbio/ws/server/resource/RegistryWS.wsdl +++ b/webservices/compbio/ws/server/resource/RegistryWS.wsdl @@ -12,6 +12,12 @@ + + + + + + @@ -24,12 +30,6 @@ - - - - - - @@ -47,6 +47,10 @@ + + + + @@ -55,10 +59,6 @@ - - - - @@ -79,7 +79,7 @@ - + @@ -88,7 +88,7 @@ - + @@ -97,7 +97,7 @@ - + diff --git a/webservices/compbio/ws/server/resource/TcoffeeWS.wsdl b/webservices/compbio/ws/server/resource/TcoffeeWS.wsdl index 415612b..6781837 100644 --- a/webservices/compbio/ws/server/resource/TcoffeeWS.wsdl +++ b/webservices/compbio/ws/server/resource/TcoffeeWS.wsdl @@ -45,18 +45,18 @@ - - - - - - + + + + + + @@ -69,11 +69,11 @@ - - + + - - + + @@ -81,11 +81,11 @@ - - + + - - + + @@ -116,14 +116,14 @@ - - - - + + + + @@ -132,17 +132,17 @@ - - - + + + - - - + + + @@ -219,7 +219,7 @@ - + @@ -228,7 +228,7 @@ - + @@ -255,7 +255,7 @@ - + @@ -273,7 +273,7 @@ - + diff --git a/webservices/compbio/ws/server/resource/TcoffeeWS_schema1.xsd b/webservices/compbio/ws/server/resource/TcoffeeWS_schema1.xsd index 9f5bbee..18262c9 100644 --- a/webservices/compbio/ws/server/resource/TcoffeeWS_schema1.xsd +++ b/webservices/compbio/ws/server/resource/TcoffeeWS_schema1.xsd @@ -152,32 +152,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -209,6 +183,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + -- 1.7.10.2