<?xml version="1.0" encoding="UTF-8"?>

<definitions name="OAI-PMH" 
             xmlns="http://schemas.xmlsoap.org/wsdl/" 
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
             xmlns:xs="http://www.w3.org/2001/XMLSchema" 
             xmlns:oai="http://www.openarchives.org/OAI/2.0/"
             xmlns:tns="http://www.ivoa.net/wsdl/RegistryHarvest/v1.0"
             targetNamespace="http://www.ivoa.net/wsdl/RegistryHarvest/v1.0">

   <types>
      <xs:schema xmlns="http://www.w3.org/2001/XMLSchema" 
                 xmlns:tns="http://www.ivoa.net/wsdl/RegistryHarvest/v1.0" 
             targetNamespace="http://www.ivoa.net/wsdl/RegistryHarvest/v1.0">

         <xs:import namespace="http://www.openarchives.org/OAI/2.0/" 
                    schemaLocation="OAI.xsd"/>                              

         <xs:element name="resumptionToken" type="xs:string"/>

         <xs:element name="Identify" />                                

         <xs:element name="IdentifyResponse">
           <xs:complexType>
             <xs:sequence>
               <xs:element minOccurs="1" maxOccurs="1" ref="oai:OAI-PMH"/>
             </xs:sequence>
           </xs:complexType>
         </xs:element>

         <xs:element name="ErrorResponse">
           <xs:complexType>
             <xs:sequence>
               <xs:element minOccurs="1" maxOccurs="1" ref="oai:OAI-PMH"/>
             </xs:sequence>
           </xs:complexType>
         </xs:element>

         <xs:element name="ListMetadataFormats">
           <xs:complexType>
             <xs:sequence>
               <xs:element name="identifier" type="xs:anyURI" minOccurs="0" maxOccurs="1"/>
             </xs:sequence>
           </xs:complexType>
         </xs:element>

         <xs:element name="ListMetadataFormatsResponse">
           <xs:complexType>
             <xs:sequence>
               <xs:element minOccurs="1" maxOccurs="1" ref="oai:OAI-PMH"/>
             </xs:sequence>
           </xs:complexType>
         </xs:element>

         <xs:element name="ListSets">
            <xs:complexType>
               <xs:sequence>
                  <xs:element ref="tns:resumptionToken" minOccurs="0"/>
               </xs:sequence>
            </xs:complexType>
         </xs:element>

         <xs:element name="ListSetsResponse">
           <xs:complexType>
             <xs:sequence>
               <xs:element minOccurs="1" maxOccurs="1" ref="oai:OAI-PMH"/>
             </xs:sequence>
           </xs:complexType>
         </xs:element>

         <xs:element name="GetRecord">
           <xs:complexType>
             <xs:sequence>
               <xs:element name="identifier" type="xs:anyURI" />
               <xs:element name="metadataPrefix" type="xs:string" />
             </xs:sequence>
           </xs:complexType>
         </xs:element>

         <xs:element name="GetRecordResponse">
           <xs:complexType>
             <xs:sequence>
               <xs:element minOccurs="1" maxOccurs="1" ref="oai:OAI-PMH"/>
             </xs:sequence>
           </xs:complexType>
         </xs:element>

         <xs:element name="ListIdentifiers">
            <xs:complexType>
                <xs:sequence>
                  <xs:group ref="tns:exclusiveArgs"/>
               </xs:sequence>
            </xs:complexType>
         </xs:element>      

         <xs:element name="ListIdentifiersResponse">
          <xs:complexType>
             <xs:sequence>
               <xs:element minOccurs="1" maxOccurs="1" ref="oai:OAI-PMH"/>
             </xs:sequence>
           </xs:complexType>
         </xs:element>

         <xs:element name="ListRecords">
            <xs:complexType>
                <xs:sequence>
                  <xs:group ref="tns:exclusiveArgs"/>
               </xs:sequence>
            </xs:complexType>
         </xs:element>

         <xs:element name="ListRecordsResponse">
           <xs:complexType>
             <xs:sequence>
               <xs:element minOccurs="1" maxOccurs="1" ref="oai:OAI-PMH"/>
             </xs:sequence>
           </xs:complexType>
         </xs:element>

         <xs:group name="exclusiveArgs">
           <xs:choice>
             <xs:element ref="tns:resumptionToken"/>
             <xs:sequence>
               <xs:element name="from" type="oai:UTCdatetimeType" 
                           minOccurs="0"/>
               <xs:element name="until" type="oai:UTCdatetimeType" 
                           minOccurs="0"/>
               <xs:element name="set" type="oai:setSpecType" minOccurs="0"/>
               <xs:element name="metadataPrefix" type="oai:metadataPrefixType"/>
             </xs:sequence>
           </xs:choice>
         </xs:group>
      </xs:schema>
   </types>

   <message name="ErrorResp">
      <part name="ErrorResp"  element="tns:ErrorResponse"/>
   </message>

   <message name="IdentifyResp">
      <part name="IdentifyResponse" element="tns:IdentifyResponse"/>
   </message>
   
   <message name="ListMetadataFormatsResp">
      <part name="ListMetadataFormatsResponse" 
            element="tns:ListMetadataFormatsResponse"/>
   </message>

   <!-- ListSets verb -->
   <!-- the ListSets operations take no inputs -->   

   <message name="ListSetsResp">
      <part name="ListSetsResponse" element="tns:ListSetsResponse"/>
   </message>

   <message name="ListIdentifiersResp">
      <part name="ListIdentifiersResponse" 
            element="tns:ListIdentifiersResponse"/>
   </message>

   <!-- GetRecord verb -->
   <message name="GetRecordReq">
      <part name="GetRecord" element="tns:GetRecord" />   
   </message>

   <message name="GetRecordResp">
      <part name="GetRecordResponse" element="tns:GetRecordResponse"/>
   </message>

   <!-- ListIdentifiers verb -->                  
   <message name="ListIdentifiersReq">
      <part name="ListIdentifiers" element="tns:ListIdentifiers" />
   </message>

   <!-- ListRecords verb -->
   <message name="ListRecordsReq">
      <part name="ListRecords" element="tns:ListRecords" />
   </message>

   <message name="ListRecordsResp">
      <part name="ListRecordsResponse" element="tns:ListRecords"/>
   </message>

   <message name="ListSetsReq">
      <part name="ListSets" element="tns:ListSets" />
   </message>

   <message name="IdentifyReq">
      <part name="ListSets" element="tns:Identify" />
   </message>

   <message name="ListMetadataFormatsReq">
      <part name="ListMetadataFormats" element="tns:ListMetadataFormats" />
   </message>

   <portType name="RegistryHarvestPortType">

      <!-- Identify verb -->
      <operation name="Identify">
         <input message="tns:IdentifyReq"/>
         <output message="tns:IdentifyResp"/>
         <fault name="IdentifyError" message="tns:ErrorResp"/>
      </operation>

      <!-- ListMetadataFormats verb -->
      <operation name="ListMetadataFormats">
         <input message="tns:ListMetadataFormatsReq"/>
         <output message="tns:ListMetadataFormatsResp"/>
         <fault name="ListMetadataFormatsError" message="tns:ErrorResp"/>
      </operation>

      <!-- ListSets verb (with resume version) -->
      <operation name="ListSets">
         <input message="tns:ListSetsReq"/>
         <output message="tns:ListSetsResp"/>
         <fault name="ListSetsError" message="tns:ErrorResp"/>
      </operation>      

      <!-- GetRecord verb -->
      <operation name="GetRecord">
         <input message="tns:GetRecordReq"/>
         <output message="tns:GetRecordResp"/>
         <fault name="GetRecordError" message="tns:ErrorResp"/>
      </operation>

      <!-- ListIdentifiers verb (with resume version) -->
      <operation name="ListIdentifiers">
         <input message="tns:ListIdentifiersReq"/>
         <output message="tns:ListIdentifiersResp"/>
         <fault name="ListIdentifiersError" message="tns:ErrorResp"/>
      </operation>

      <!-- ListRecords verb (with resume version) -->
      <operation name="ListRecords">
         <input message="tns:ListRecordsReq"/>
         <output message="tns:ListRecordsResp"/>
         <fault name="ListRecordsError" message="tns:ErrorResp"/>
      </operation>      

   </portType>

   <binding name="RegistryHarvestSOAP" type="tns:RegistryHarvestPortType">
      <soap:binding style="document" 
                    transport="http://schemas.xmlsoap.org/soap/http"/>
                    
      <!-- Identify verb -->
      <operation name="Identify">
         <soap:operation 
              soapAction="http://www.ivoa.net/wsdl/RegistryInterface#Identify"/>
         <input>
            <soap:body use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </input>
         <output>
            <soap:body use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </output>
         <fault name="IdentifyError">
            <soap:fault name="IdentifyError" use="literal" 
                        namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </fault>
      </operation>
      
      <!-- ListMetadataFormats verb -->
      <operation name="ListMetadataFormats">
         <soap:operation 
   soapAction="http://www.ivoa.net/wsdl/RegistryInterface#ListMetadataFormats"/>
         <input>
            <soap:body use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </input>
         <output>
            <soap:body use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </output>
         <fault name="ListMetadataFormatsError">
            <soap:fault name="ListMetadataFormatsError" use="literal" 
                        namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </fault>
      </operation>   

      <!-- ListSets verb (with resume version) -->
      <operation name="ListSets">
         <soap:operation 
              soapAction="http://www.ivoa.net/wsdl/RegistryInterface#ListSets"/>
         <input>
            <soap:body use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </input>
         <output>
            <soap:body use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </output>
         <fault name="ListSetsError">
            <soap:fault name="ListSetsError" use="literal" 
                        namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </fault>
      </operation>

      <!-- GetRecord verb -->
      <operation name="GetRecord">
         <soap:operation 
             soapAction="http://www.ivoa.net/wsdl/RegistryInterface#GetRecord"/>
         <input>
            <soap:body use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </input>
         <output>
            <soap:body use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </output>
         <fault name="GetRecordError">
            <soap:fault name="GetRecordError" use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </fault>
      </operation>
   
      <!-- ListIdentifiers verb (with resume version) -->
      <operation name="ListIdentifiers">
         <soap:operation 
       soapAction="http://www.ivoa.net/wsdl/RegistryInterface#ListIdentifiers"/>
         <input>
            <soap:body use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </input>
         <output>
            <soap:body use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </output>
         <fault name="ListIdentifiersError">
            <soap:fault name="ListIdentifiersError" use="literal" 
                        namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </fault>
      </operation>

      <!-- ListRecords verb (with resume version) -->
      <operation name="ListRecords">
         <soap:operation 
           soapAction="http://www.ivoa.net/wsdl/RegistryInterface#ListRecords"/>
         <input>
            <soap:body use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </input>
         <output>
            <soap:body use="literal" 
                       namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </output>
         <fault name="ListRecordsError">
            <soap:fault name="ListRecordsError" use="literal" 
                        namespace="http://www.ivoa.net/wsdl/RegistryInterface"/>
         </fault>
      </operation>

   </binding>

   <!--
     - To use this WSDL to declare a particular implementation of this 
     - service, you can either uncomment and edit the service section below,
     - OR create another WSDL document that 
     -   1.  imports this WSDL using an <import> element
     -   2.  contains a <service> element with binding="rh:RegistryHarvestSOAP",
     -       where rh maps to this WSDL's target namespace
     -->

<!--
   <service name="RegistryInterfaceService">
      <port name="RegistryHarvestPort" binding="rih:RegistryHarvestSOAP">
         <soap:address location="http://myhost.org/ws/RegistryHarvest"/>
      </port>
   </service>
  -->

</definitions>
