<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
	xmlns:tns="http://cathdb.info/FuncNet_0_1/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="FuncNet-0.1"
	targetNamespace="http://cathdb.info/FuncNet_0_1/">
	
	<wsdl:types>
	
		<xsd:schema targetNamespace="http://cathdb.info/FuncNet_0_1/">

			<xsd:complexType name="ProteinList">
				<xsd:annotation>
					<xsd:documentation>
						A list of one or more UniProt primary accession numbers.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="p" type="xsd:string" minOccurs="1" maxOccurs="unbounded" />
				</xsd:sequence>
			</xsd:complexType>
			
			<xsd:complexType name="PredictorStatus">
				<xsd:annotation>
					<xsd:documentation>
						A pair of strings giving (1) the name of a predictor and
						(2) the status of that predictor with regard to a recently
						completed query. Status can be COMPLETE (finished with no errors),
						TIMEOUT (request to predictor timed out), WORKING (query
						is currently in progress, optionally followed by a string
						describing the progress so far), or ERROR followed by a
						string describing the error itself.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="predictor" type="xsd:string" />
					<xsd:element name="status" type="xsd:string" />
				</xsd:sequence>
			</xsd:complexType>
			
			<xsd:complexType name="JobLocator">
				<xsd:annotation>
					<xsd:documentation>
						A jobID and the email address that was used when submitting
						the job. Both must be supplied when requesting the status
						or results of a job, or cancelling a job.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="jobID" type="xsd:string" />
					<xsd:element name="emailAddress" type="xsd:string" />
				</xsd:sequence>
			</xsd:complexType>

			<xsd:complexType name="PairwiseScore">
				<xsd:annotation>
					<xsd:documentation>
						A 4-tuple containing the score results for a single pair of proteins.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="p1" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>
								The query protein.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="p2" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>
								The reference protein.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="rs" type="xsd:double">
						<xsd:annotation>
							<xsd:documentation>
								A numeric score produced by running the p-values produced by
								the individual predictors through Fisher's Unweighted Method.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="pv" type="xsd:double">
						<xsd:annotation>
							<xsd:documentation>
								A p-value representing the probability that any two randomly-
								chosen proteins in this proteome would be given an rs score
								equal to or higher than the rs for this pair, by the
								same process.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:complexType>

			<xsd:complexType name="SetwiseScore">
				<xsd:annotation>
					<xsd:documentation>
						A 4-tuple containing the score results for a single protein against
						the whole reference set.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="p" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>
								The query protein.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="rs" type="xsd:double">
						<xsd:annotation>
							<xsd:documentation>
								A numeric score reflecting how closely related this protein is
								to the biological function embodied by the reference set.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="pv" type="xsd:double">
						<xsd:annotation>
							<xsd:documentation>
								A p-value representing the probability that any randomly-
								chosen protein in this proteome would be given an rs score
								equal to or higher than the rs for this one, by the
								same process.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:complexType>
			
			<xsd:complexType name="ScoreProfile">
				<xsd:annotation>
					<xsd:documentation>
						A list of scores and p-values for a pair of proteins across a number of predictors,
						along with an overall score and p-value.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:sequence>
					<xsd:element name="p1" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>
								The query protein.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="p2" type="xsd:string">
						<xsd:annotation>
							<xsd:documentation>
								The reference protein.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:sequence minOccurs="1" maxOccurs="unbounded">
						<xsd:element name="p-rs" type="xsd:double">
							<xsd:annotation>
								<xsd:documentation>
									A numeric score reflecting how closely related these two protein
									are, according to one specific predictor.
								</xsd:documentation>
							</xsd:annotation>
						</xsd:element>
						<xsd:element name="p-pv" type="xsd:double">
							<xsd:annotation>
								<xsd:documentation>
									A p-value representing the probability that any randomly-
									chosen protein in this proteome would be given an rs score
									equal to or higher than the rs for this one, by the
									same predictor.
								</xsd:documentation>
							</xsd:annotation>
						</xsd:element>
					</xsd:sequence>
					<xsd:element name="f-rs" type="xsd:double">
						<xsd:annotation>
							<xsd:documentation>
								A numeric score produced by running the p-values produced by
								the individual predictors through Fisher's Unweighted Method.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
					<xsd:element name="f-pv" type="xsd:double">
						<xsd:annotation>
							<xsd:documentation>
								A p-value representing the probability that any two randomly-
								chosen proteins in this proteome would be given an f-rs score
								equal to or higher than the rs for this pair, by the
								same process.
							</xsd:documentation>
						</xsd:annotation>
					</xsd:element>
				</xsd:sequence>
			</xsd:complexType>

			<xsd:element name="SubmitTwoProteinSets">
				<xsd:annotation>
					<xsd:documentation>
						Use SubmitTwoProteinSets to request a comparison of two sets of
						proteins. You must supply an email address in order to retrieve
						the results later. If enableEmailNotify is set to true, you will
						receive an email notifying you when the job has completed.
						Otherwise you will need to keep calling the MonitorJob operation.
						NB Your email address will be logged and used to contact you in
						case of any problems, changes to the service etc. We will not pass
						it on to any third parties.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="queryProteins" type="tns:ProteinList" />
						<xsd:element name="refProteins" type="tns:ProteinList" />
						<xsd:element name="emailAddress" type="xsd:string" />
						<xsd:element name="enableEmailNotify" type="xsd:boolean" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:element name="SubmitTwoProteinSetsResponse">
				<xsd:annotation>
					<xsd:documentation>
						After submitting a job you will immediately receive a unique,
						randomly-generated jobID. You will need to supply this (along
						with your email address) in order to monitor, cancel or retrieve
						the results of a job.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="jobID" type="xsd:string" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			
			<xsd:element name="MonitorJob">
				<xsd:annotation>
					<xsd:documentation>
						Use MonitorJob to check on the status of a job you've submitted,
						by supplying the jobID and your email address.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="jobLocator" type="tns:JobLocator" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:element name="MonitorJobResponse">
				<xsd:annotation>
					<xsd:documentation>
						The status code can be COMPLETE (job finished with no errors), WORKING
						(job is currently in progress, optionally followed by a string
						describing the progress so far), CANCELLED (cancelled by user using
						CancelJob), FAILURE (job failed to start, followed by a string
						describing the details of the error), EXPIRED (the job was cleaned off
						the server after a pre-defined period of time had elapsed since
						completion -- 24 hours?) or UNKNOWN (an unrecognized jobID was supplied).
						NB A COMPLETE job is not necessarily error-free; this just means that
						all predictors have finished executing, successfully or not. Use one
						of the Retrieve operations to get the individual results by predictor.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="status" type="xsd:string" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			
			<xsd:element name="CancelJob">
				<xsd:annotation>
					<xsd:documentation>
						Use CancelJob to completely abort a job you've submitted,
						by supplying the jobID and your email address. All temporary
						files etc. on the server will be deleted, and no results will
						be obtainable for this job.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="jobLocator" type="tns:JobLocator" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:element name="CancelJobResponse">
				<xsd:annotation>
					<xsd:documentation>
						The status code can only be CANCELLED (if the job aborted cleanly)
						or ERROR followed by a string describing the error itself (if
						an error occurred during the cancellation process).
					</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="status" type="xsd:string" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			
			<xsd:element name="RetrievePairwiseScores">
				<xsd:annotation>
					<xsd:documentation>
						Use RetrievePairwiseScores to retrieve the results of a job you've submitted,
						in the form of a list of query protein/reference protein score pairs. You
						must supply both the jobID and your email address.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="jobLocator" type="tns:JobLocator" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			
			<xsd:element name="RetrievePairwiseScoresResponse">
				<xsd:annotation>
					<xsd:documentation>
						The output of RetrievePairwiseScores contains a human-readable comments
						field (remember to inspect this, or log it, in case it contains important
						information), a list of predictor status codes, and a list of scores.
						If this is called before the job is complete, the list of scores will be
						empty.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="comments" type="xsd:string" />
						<xsd:element name="predictorStatus" type="tns:PredictorStatus" minOccurs="1" maxOccurs="unbounded" />
						<xsd:element name="s" type="tns:PairwiseScore" minOccurs="0" maxOccurs="unbounded" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:element name="RetrieveSetwiseScores">
				<xsd:annotation>
					<xsd:documentation>
						Use RetrieveSetwiseScores to retrieve the results of a job you've submitted,
						in the form of a score for each query protein vs. the reference set. You
						must supply both the jobID and your email address.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="jobLocator" type="tns:JobLocator" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			
			<xsd:element name="RetrieveSetwiseScoresResponse">
				<xsd:annotation>
					<xsd:documentation>
						The output of RetrieveSetwiseScores contains a human-readable comments
						field (remember to inspect this, or log it, in case it contains important
						information), a list of predictor status codes, and a list of scores.
						If this is called before the job is complete, the list of scores will be
						empty.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="comments" type="xsd:string" />
						<xsd:element name="predictorStatus" type="tns:PredictorStatus" minOccurs="1" maxOccurs="unbounded" />
						<xsd:element name="s" type="tns:SetwiseScore" minOccurs="0" maxOccurs="unbounded" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>

			<xsd:element name="RetrieveCompleteScores">
				<xsd:annotation>
					<xsd:documentation>
						Use RetrieveCompleteScores to retrieve the results of a job you've submitted,
						in the form of a complete score profile for each query protein/reference protein
						pair across all the predictors, along with an overall score for each pair.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="jobLocator" type="tns:JobLocator" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
			
			<xsd:element name="RetrieveCompleteScoresResponse">
				<xsd:annotation>
					<xsd:documentation>
						The output of RetrieveCompleteScores contains a human-readable comments
						field (remember to inspect this, or log it, in case it contains important
						information), a list of predictors and status codes, and a list of score profiles.
						The scores in the score profile occur in the same order as the predictors in
						the status list. If this is called before the job is complete, or there was
						a problem with one or more predictors, the score profiles will be incomplete.
						Any missing scores (for whatever reason) will be set to null.
					</xsd:documentation>
				</xsd:annotation>
				<xsd:complexType>
					<xsd:sequence>
						<xsd:element name="comments" type="xsd:string" />
						<xsd:element name="predictorStatus" type="tns:PredictorStatus" minOccurs="1" maxOccurs="unbounded" />
						<xsd:element name="s" type="tns:ScoreProfile" minOccurs="0" maxOccurs="unbounded" />
					</xsd:sequence>
				</xsd:complexType>
			</xsd:element>
		</xsd:schema>
		
	</wsdl:types>
	
	<wsdl:message name="SubmitTwoProteinSetsRequest">
		<wsdl:part element="tns:SubmitTwoProteinSets" name="parameters" />
	</wsdl:message>
	
	<wsdl:message name="SubmitTwoProteinSetsResponse">
		<wsdl:part element="tns:SubmitTwoProteinSetsResponse" name="parameters" />
	</wsdl:message>
	
	<wsdl:message name="MonitorJobRequest">
		<wsdl:part element="tns:MonitorJob" name="parameters" />
	</wsdl:message>

	<wsdl:message name="MonitorJobResponse">
		<wsdl:part element="tns:MonitorJobResponse" name="parameters" />
	</wsdl:message>

	<wsdl:message name="CancelJobRequest">
		<wsdl:part element="tns:CancelJob" name="parameters" />
	</wsdl:message>

	<wsdl:message name="CancelJobResponse">
		<wsdl:part element="tns:CancelJobResponse" name="parameters" />
	</wsdl:message>

	<wsdl:message name="RetrievePairwiseScoresRequest">
		<wsdl:part element="tns:RetrievePairwiseScores" name="parameters" />
	</wsdl:message>

	<wsdl:message name="RetrievePairwiseScoresResponse">
		<wsdl:part element="tns:RetrievePairwiseScoresResponse" name="parameters" />
	</wsdl:message>

	<wsdl:message name="RetrieveSetwiseScoresRequest">
		<wsdl:part element="tns:RetrieveSetwiseScores" name="parameters" />
	</wsdl:message>

	<wsdl:message name="RetrieveSetwiseScoresResponse">
		<wsdl:part element="tns:RetrieveSetwiseScoresResponse" name="parameters" />
	</wsdl:message>

	<wsdl:message name="RetrieveCompleteScoresRequest">
		<wsdl:part element="tns:RetrieveCompleteScores" name="parameters" />
	</wsdl:message>

	<wsdl:message name="RetrieveCompleteScoresResponse">
		<wsdl:part element="tns:RetrieveCompleteScoresResponse" name="parameters" />
	</wsdl:message>

	<wsdl:portType name="FrontEndPortType">
		<wsdl:operation name="SubmitTwoProteinSets">
			<wsdl:input message="tns:SubmitTwoProteinSetsRequest" />
			<wsdl:output message="tns:SubmitTwoProteinSetsResponse" />
		</wsdl:operation>
		<wsdl:operation name="MonitorJob">
			<wsdl:input message="tns:MonitorJobRequest" />
			<wsdl:output message="tns:MonitorJobResponse" />
		</wsdl:operation>
		<wsdl:operation name="CancelJob">
			<wsdl:input message="tns:CancelJobRequest" />
			<wsdl:output message="tns:CancelJobResponse" />
		</wsdl:operation>
		<wsdl:operation name="RetrievePairwiseScores">
			<wsdl:input message="tns:RetrievePairwiseScoresRequest" />
			<wsdl:output message="tns:RetrievePairwiseScoresResponse" />
		</wsdl:operation>
		<wsdl:operation name="RetrieveSetwiseScores">
			<wsdl:input message="tns:RetrieveSetwiseScoresRequest" />
			<wsdl:output message="tns:RetrieveSetwiseScoresResponse" />
		</wsdl:operation>
		<wsdl:operation name="RetrieveCompleteScores">
			<wsdl:input message="tns:RetrieveCompleteScoresRequest" />
			<wsdl:output message="tns:RetrieveCompleteScoresResponse" />
		</wsdl:operation>
	</wsdl:portType>
	
	<wsdl:binding name="FrontEndBinding" type="tns:FrontEndPortType">
		<soap:binding style="document"
			transport="http://schemas.xmlsoap.org/soap/http" />
		<wsdl:operation name="SubmitTwoProteinSets">
			<soap:operation soapAction="http://cathdb.info/FuncNet_0_1/FrontEnd/SubmitTwoProteinSets" />
			<wsdl:input>
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="MonitorJob">
			<soap:operation soapAction="http://cathdb.info/FuncNet_0_1/FrontEnd/MonitorJob" />
			<wsdl:input>
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="CancelJob">
			<soap:operation soapAction="http://cathdb.info/FuncNet_0_1/FrontEnd/CancelJob" />
			<wsdl:input>
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="RetrievePairwiseScores">
			<soap:operation soapAction="http://cathdb.info/FuncNet_0_1/FrontEnd/RetrievePairwiseScores" />
			<wsdl:input>
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="RetrieveSetwiseScores">
			<soap:operation soapAction="http://cathdb.info/FuncNet_0_1/FrontEnd/RetrieveSetwiseScores" />
			<wsdl:input>
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
		<wsdl:operation name="RetrieveCompleteScores">
			<soap:operation soapAction="http://cathdb.info/FuncNet_0_1/FrontEnd/RetrieveCompleteScores" />
			<wsdl:input>
				<soap:body use="literal" />
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal" />
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	
	<wsdl:service name="FrontEndService">
		<wsdl:port binding="tns:FrontEndBinding" name="FrontEndPort">
			<soap:address location="http://localhost:9001/FrontEnd" />
		</wsdl:port>
	</wsdl:service>
	
</wsdl:definitions>

<!--

Example response for RetrieveCompleteScore because it's quite complex...

<p-rs> and <p-pv> are be repeated in each score profile as many times as there are predictors
in the status list.

<s> is repeated as many times as there are protein pairs with one or more scores available.

      <fun:RetrieveCompleteScoresResponse>
         <comments>?</comments>
         <predictorStatus>
            <predictor>?</predictor>
            <status>?</status>
         </predictorStatus>
         <s>
            <p1>?</p1>
            <p2>?</p2>
            <p-rs>?</p-rs>
            <p-pv>?</p-pv>
            <f-rs>?</f-rs>
            <f-pv>?</f-pv>
         </s>
      </fun:RetrieveCompleteScoresResponse>

-->
