<?xml version="1.0" encoding="UTF-8"?>\r
<endpoints xmlns='http://java.sun.com/xml/ns/jax-ws/ri/runtime' version='2.0'>\r
<endpoint name='JpredWS'\r
- implementation='compbio.ws.jpred.Jpred'\r
- url-pattern='/JpredWS'/>\r
+ implementation='compbio.ws.jpred.JpredWS'\r
+ url-pattern='/ProteoCacheWS'/>\r
</endpoints>\r
<listener>\r
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>\r
</listener>\r
-\r
+ <listener>\r
+ <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class>\r
+ </listener>\r
+ \r
<context-param>\r
<param-name>contextConfigLocation</param-name>\r
<param-value>\r
package compbio.ws.jpred;
+import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
-@WebService(targetNamespace = "http://server.ws.compbio")
+@WebService(targetNamespace = "http://server.proteocache.ws")
public interface Jpred {
-
- public String findSequence(@WebParam(name = "sequence") String sequence);
-
+ @WebMethod
+ public String findSequence(@WebParam(name = "sequence") String sequence, @WebParam(name = "program") String program,
+ @WebParam(name = "version") String version);
}
package compbio.ws.jpred;
-import java.util.Properties;
-
import javax.xml.ws.Service;
import javax.xml.namespace.QName;
import java.net.URL;
/**
- * This class was generated by Apache CXF 2.7.8 2013-12-09T11:22:58.858Z
- * Generated source version: 2.7.8
*
*/
public class JpredClient {
public static void main(String[] args) throws Exception {
- Properties properties = new Properties();
- properties.setProperty("openejb.embedded.remotable", "true");
- QName qname = new QName("http://server.ws.compbio", "JpredWS");
- Service service = Service.create(new URL("http://localhost:1236/proteocache/services"), qname);
+ QName qname = new QName("http://server.proteocache.ws", "ProteoCacheWS");
+
+ Service service = Service.create(new URL("http://localhost:8080/proteocache-1.0/ProteoCacheWS"), qname);
Jpred sequense = service.getPort(Jpred.class);
- System.out.println(" : " + sequense.findSequence("MDVQAAPALMLCSATPALRRHGGMTGPVRLSGDIRC"));
+ String result= sequense.findSequence("EQCGRQAGGKLCPNNLCCSQWGWCGSTDEYCS", "Jpred", "3.0.1");
+
+ System.out.println("Result : " + result);
}
}
import javax.jws.WebService;
+import org.apache.log4j.Logger;
+
import compbio.cassandra.CassandraNativeConnector;
-import compbio.statistic.CassandraRequester;
+import compbio.cassandra.readers.SequenceReader;
-@WebService(endpointInterface = "compbio.ws.jpred.Jpred", targetNamespace = "http://server.ws.compbio", serviceName = "JpredWS")
+@WebService(endpointInterface = "compbio.ws.jpred.Jpred", targetNamespace = "http://server.proteocache.ws", serviceName = "ProteoCacheWS", portName = "ProteoCacheWSPort")
public class JpredWS implements Jpred {
+ private static Logger log = Logger.getLogger(CassandraNativeConnector.class);
@Override
- public String findSequence(String sequence) {
+ public String findSequence(String sequence, String program, String version) {
CassandraNativeConnector dbconnector = new CassandraNativeConnector();
- CassandraRequester cr = new CassandraRequester();
- System.out.println("YES");
- if (cr.readProteins(sequence, "whole") != null)
- return "The sequence is " + sequence;
- else
- return "No sequence " + sequence;
+ SequenceReader reader = new SequenceReader();
+ reader.setSession(dbconnector.getSession());
+ log.debug("ProteoCacheWS is connected:\n search for sequence: " + sequence + "\ncalculated wih " + program + " (version; " + version + ")");
+ if (null != reader.readProteins(sequence, "whole")) {
+ return "The sequence " + sequence + " found. Calculated with " + program + "(" + version + ")";
+ }
+ return "The sequence " + sequence + " not found";
}
}
+++ /dev/null
-package compbio.ws.jpred;
-
-import javax.xml.ws.Endpoint;
-
-public class WSPublisher {
-
- public static void main(String[] args) {
- Endpoint.publish("http://localhost:1236/proteocache/services", new JpredWS());
-
- System.out.println("Service is published!");
- }
-}
--- /dev/null
+package compbio.ws.jpred.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 = "findSequence", namespace = "http://server.proteocache.ws")
+@XmlAccessorType(XmlAccessType.FIELD)
+@XmlType(name = "findSequence", namespace = "http://server.proteocache.ws", propOrder = { "sequence", "program", "version" })
+public class FindSequence {
+
+ @XmlElement(name = "sequence", namespace = "")
+ private String sequence;
+ @XmlElement(name = "program", namespace = "")
+ private String program;
+ @XmlElement(name = "version", namespace = "")
+ private String version;
+
+ /**
+ *
+ * @return returns String
+ */
+ public String getSequence() {
+ System.out.println("FindSequence.setSequence: output sequence " + this.sequence);
+ return this.sequence;
+ }
+
+ /**
+ *
+ * @param sequence
+ * the value for the sequence property
+ */
+ public void setSequence(String sequence) {
+ System.out.println("FindSequence.setSequence: input sequence " + sequence);
+ this.sequence = sequence;
+ }
+
+ /**
+ *
+ * @return returns String
+ */
+ public String getProgram() {
+ System.out.println("FindSequence.setProgram: output program " + this.program);
+ return this.program;
+ }
+
+ /**
+ *
+ * @param program
+ * the value for the program property
+ */
+ public void setProgram(String program) {
+ System.out.println("FindSequence.setProgram: input program " + program);
+ this.program = program;
+ }
+
+ /**
+ *
+ * @return returns String
+ */
+ public String getVersion() {
+ System.out.println("FindSequence.setVersion: output version " + this.version);
+ return this.version;
+ }
+
+ /**
+ *
+ * @param version
+ * the value for the version property
+ */
+ public void setVersion(String version) {
+ System.out.println("FindSequence.setVersion: input version " + version);
+ this.version = version;
+ }
+
+}
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
-@XmlRootElement(name = "findSequenceResponse", namespace = "http://server.ws.compbio")
+@XmlRootElement(name = "findSequenceResponse", namespace = "http://server.proteocache.ws")
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "findSequenceResponse", namespace = "http://server.ws.compbio")
+@XmlType(name = "findSequenceResponse", namespace = "http://server.proteocache.ws")
public class FindSequenceResponse {
@XmlElement(name = "return", namespace = "")
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is Metro/2.1 (branches/2.1-6728; 2011-02-03T14:14:58+0000) JAXWS-RI/2.2.3 JAXWS/2.2. -->
+<definitions targetNamespace="http://server.proteocache.ws" name="ProteoCacheWS" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:tns="http://server.proteocache.ws" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
+ <types>
+ <xsd:schema>
+ <xsd:import namespace="http://server.proteocache.ws" schemaLocation="ProteoCacheWS_schema1.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="findSequence">
+ <part name="parameters" element="tns:findSequence"/>
+ </message>
+ <message name="findSequenceResponse">
+ <part name="parameters" element="tns:findSequenceResponse"/>
+ </message>
+ <portType name="Jpred">
+ <operation name="findSequence">
+ <input wsam:Action="http://server.proteocache.ws/Jpred/findSequenceRequest" message="tns:findSequence"/>
+ <output wsam:Action="http://server.proteocache.ws/Jpred/findSequenceResponse" message="tns:findSequenceResponse"/>
+ </operation>
+ </portType>
+ <binding name="ProteoCacheWSPortBinding" type="tns:Jpred">
+ <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
+ <operation name="findSequence">
+ <soap:operation soapAction=""/>
+ <input>
+ <soap:body use="literal"/>
+ </input>
+ <output>
+ <soap:body use="literal"/>
+ </output>
+ </operation>
+ </binding>
+ <service name="ProteoCacheWS">
+ <port name="ProteoCacheWSPort" binding="tns:ProteoCacheWSPortBinding">
+ <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
+ </port>
+ </service>
+</definitions>
+
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<xs:schema version="1.0" targetNamespace="http://server.proteocache.ws" xmlns:tns="http://server.proteocache.ws" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+
+ <xs:element name="findSequence" type="tns:findSequence"/>
+
+ <xs:element name="findSequenceResponse" type="tns:findSequenceResponse"/>
+
+ <xs:complexType name="findSequence">
+ <xs:sequence>
+ <xs:element name="sequence" type="xs:string" minOccurs="0"/>
+ <xs:element name="program" type="xs:string" minOccurs="0"/>
+ <xs:element name="version" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="findSequenceResponse">
+ <xs:sequence>
+ <xs:element name="return" type="xs:string" minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
+
+++ /dev/null
-
-package compbio.ws.jpred.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 = "findSequence", namespace = "http://server.ws.compbio")
-@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "findSequence", namespace = "http://server.ws.compbio")
-public class FindSequence {
-
- @XmlElement(name = "sequence", namespace = "")
- private String sequence;
-
- /**
- *
- * @return
- * returns String
- */
- public String getSequence() {
- return this.sequence;
- }
-
- /**
- *
- * @param sequence
- * the value for the sequence property
- */
- public void setSequence(String sequence) {
- this.sequence = sequence;
- }
-
-}
</fileset>
</path>
- <property name="wsdl.dir" location="${basedir}/webapp/resources" />
- <property name="jpred.wsdl" location="${wsdl.dir}/JpredWS.wsdl" />
+ <property name="wsdl.dir" location="${basedir}/server/compbio/ws/resources" />
+ <property name="jpred.wsdl" location="${wsdl.dir}/ProteoCacheWS.wsdl" />
<taskdef name="wsgen" onerror="report" classname="com.sun.tools.ws.ant.WsGen">
<classpath refid="project.classpath" />
<target name="main">
<!-- TODO this runs file from Eclipse, but with Ant only this need to depends on clean and build! -->
- <property name="server.artifacts.dir" location="${basedir}/webapp/compbio/ws/jpred/jaxws/" />
+ <property name="server.artifacts.dir" location="${basedir}/server/compbio/ws/jpred/jaxws/" />
<mkdir dir="${server.artifacts.dir}" />
<mkdir dir="${wsdl.dir}" />
<!-- sourcedestdir - Where to put generated source files -->
<!-- resourcedestdir - Where to put generated source files -->
<wsgen sei="compbio.ws.jpred.JpredWS"
- sourcedestdir="${basedir}/webapp"
+ sourcedestdir="${basedir}/server"
destdir="${classes}"
resourcedestdir="${wsdl.dir}"
keep="true"