<?xml version="1.0"?>

<definitions name="OMA"
             targetNamespace="urn:OMA"
             xmlns:typens="urn:OMA"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
             xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
             xmlns="http://schemas.xmlsoap.org/wsdl/">

  <!-- Types definitions -->

  <types>

      <xsd:element name="ID" type="xsd:string"/>

      <xsd:complexType name="ListOfIDs">
        <xsd:complexContent>
          <xsd:restriction base="soapenc:Array">
             <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:string[]"/>
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>

       <xsd:complexType name="ListOfListOfIDs">
        <xsd:complexContent>
          <xsd:restriction base="soapenc:Array">
             <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:ListOfIDs[]"/>
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>

	<xsd:complexType name="IDTypeDef">
		<xsd:sequence>
			<xsd:element name="TypeNr" type="xsd:integer"/>
			<xsd:element name="TypeName" type="xsd:string"/>
  		</xsd:sequence>
	</xsd:complexType>

       <xsd:complexType name="ListOdIDTypeDefs">
        <xsd:complexContent>
          <xsd:restriction base="soapenc:Array">
             <xsd:attribute ref="soapenc:arrayType" wsdl:arrayType="typens:IDTypeDef"/>
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>


  </types> 

  <!-- Messages: Input and return type signatures for all functions -->
            
  <!--  ListOrthologs: (entry:string) -> (Orthologs:array(Ortholog)) -->
  <message name="ListOrthologs">
    <part name="EntryID" type="xsd:string"/>
  </message>

  <message name="ListOrthologsResponse">
    <part name="IDs"  type="typens:ListOfIDs"/>
  </message>

  <!--  MatrixName: () -> (name,NumSpecies,NumGroups) -->
  <message name="GetMatrixInfo"/>

  <message name="GetMatrixInfoResponse">
    <part name="Name"  type="xsd:string"/>
    <part name="NumSpecies"  type="xsd:integer"/>
    <part name="NumGroups"  type="xsd:integer"/>
  </message>

  <!--  TestOrthology: (entry1:string, entry2:string) -> (orthotype:string) -->
  <message name="TestOrthology">
    <part name="EntryID1"  type="xsd:string"/>
    <part name="EntryID2"  type="xsd:string"/>
  </message>

  <message name="TestOrthologyResponse">
    <part name="OrthoType"     type="xsd:string"/>
  </message>

  <!-- GetEntry: (entry:string) -> (IDs,sequence,organism,OMAGroup) -->
  <message name="GetEntry">
    <part name="EntryID" type="xsd:string"/>
  </message>

  <message name="GetEntryResponse">
    <part name="IDs"     type="typens:ListOfIDs"/>
    <part name="Sequence"   type="xsd:string"/>
    <part name="Organism"   type="xsd:string"/>
    <part name="OMAGroup"   type="xsd:integer"/>
  </message>

  <!-- IdentifySequence: (sequence:string) -> (IDs:array(string)) -->
  <message name="IdentifySequence">
    <part name="Sequence"            type="xsd:string"/>
  </message>

  <message name="IdentifySequenceResponse">
    <part name="IDs"     type="typens:ListOfIDs"/>
  </message>

  <!-- GetOMAGroup: (GroupNr:integer) -> (IDs:array(string)) -->
  <message name="GetOMAGroup">
    <part name="GroupNr" type="xsd:integer"/>
  </message>

  <message name="GetOMAGroupResponse">
    <part name="IDs"     type="typens:ListOfIDs"/>
  </message>

  <!--  ListIDTypes: () -> array([IDNR:integer,IDName:string]) -->
  <message name="ListIDTypes"/>

  <message name="ListIDTypesResponse">
    <part name="IDLists"     type="typens:ListOfIDTypeDefs"/>
  </message>

  <!-- MapIDs: (InIDs:list(string),OutType:integer) -> (OutIds:list(list(string))) -->
  <message name="MapIDs">
    <part name="InIDs" type="typens:ListOfIDs"/>
    <part name="OutType" type="xsd:integer"/>
  </message>

  <message name="MapIDsResponse">
    <part name="OutIDs"     type="typens:ListOfListOfIDs"/>
  </message>


  <!-- Port: Function headers -->

  <portType name="OMAPort">

    <operation name="TestOrthology">
<documentation>
Test the orthology relationship between two entries. Possible answers are 'not orthologous', 
'1:1 orthologs', '1:many orthologs' or 'many:1 orthologs'.
The two parameters are preferably OMA entry identifiers (e.g. ECOLI1190). Many other
IDs are also supported (e.g. Ensembl protein/gene identifiers, SwissProt IDs, etc.) whenever
they were annotated in the original databases.
</documentation>
      <input message="typens:TestOrthology"/>
      <output message="typens:TestOrthologyResponse"/>
    </operation>

    <operation name="ListOrthologs">
<documentation>
Lists all orthologs for a given entry. To learn more about the exact relationship
to the returned entries, use the TestOrthology function. To get more information,
specifically the protein sequence and the organism, use the GetEntry function.
The argument is preferably an OMA entry identifier (e.g. ECOLI1190). Many other
IDs are also supported (e.g. Ensembl protein/gene identifiers, SwissProt IDs, etc.),
whenever they were annotated in the original databases.
</documentation>
      <input message="typens:ListOrthologs"/>
      <output message="typens:ListOrthologsResponse"/>
    </operation>

    <operation name="GetOMAGroup">
<documentation>
For any OMA group, this function returns a list IDs of all 
member proteins.
</documentation>
      <input message="typens:GetOMAGroup"/>
      <output message="typens:GetOMAGroupResponse"/>
    </operation>

    <operation name="GetEntry">
<documentation>
Given an OMA entry identifier or another ID, this functions lists all possible
IDs and cross-references for this entry that were found in the original database.
Also returned are the protein sequence, the OMA group and the organism name.
</documentation>
      <input message="typens:GetEntry"/>
      <output message="typens:GetEntryResponse"/>
    </operation>

    <operation name="IdentifySequence">
<documentation>
This function provides an easy way to map any sequence to the OMA
entries by searching the input protein sequence in the OMA database.
A list of all entries that contain this sequence is returned.
</documentation>
      <input message="typens:IdentifySequence"/>
      <output message="typens:IdentifySequenceResponse"/>
    </operation>

    <operation name="GetMatrixInfo">
<documentation>
This function returns the name of the current data set as well as
the number of species and OMA groups in this data set.
</documentation>
      <input message="typens:GetMatrixInfo"/>
      <output message="typens:GetMatrixInfoResponse"/>
    </operation>

<operation name="ListIDTypes">
<documentation>
Get the list of ID types, which is of the form
[[0,"OMA ID"], [1,"SwissProt ID"], ...].
</documentation>
      <input message="typens:ListIDTypes"/>
      <output message="typens:ListIDTypesResponse"/>
    </operation>

<operation name="MapIDs">
<documentation>
Map a list of IDs (of any type) to a IDs of a specified type.
Use the ListIDType command to obtain a list of possible ID types
</documentation>
      <input message="typens:MapIDs"/>
      <output message="typens:MapIDsResponse"/>
    </operation>

  </portType>


  <!-- Binding: more about function headers (?) -->

  <binding name="OMABinding" type="typens:OMAPort">
    <soap:binding style="rpc"
                  transport="http://schemas.xmlsoap.org/soap/http"/>

    <operation name="TestOrthology">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
    </operation>

    <operation name="GetMatrixInfo">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
    </operation>

    <operation name="ListOrthologs">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
    </operation>

    <operation name="GetEntry">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
    </operation>
    
    <operation name="IdentifySequence">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
    </operation>

    <operation name="GetOMAGroup">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
    </operation>

    <operation name="ListIDTypes">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
    </operation>

    <operation name="MapIDs">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
        <soap:body use="encoded"
                   namespace="urn:OMA"
                   encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
    </operation>


  </binding>

  <!-- Endpoint for OMA API -->
  <service name="OMA">
    <documentation>SOAP interface for the OMA Browser at http://omabrowser.org</documentation>
    <port name="OMAPort" binding="typens:OMABinding">
      <soap:address location="http://www.omabrowser.org/cgi-bin/soap.pl"/>
    </port>
  </service>

</definitions>
