<?xml version="1.0" encoding="utf-8" ?>
<!-- $Id: CeaRest.wsdl,v 1.2 2007/05/08 13:00:34 pharriso Exp $ -->
<!-- this is an attempt to specify the REST cea interface in wsdl 2 -->
<!-- N.B. incomplete -->
<description xmlns="http://www.w3.org/ns/wsdl"
   targetNamespace="http://www.ivoa.net/wsdl/CEA/REST/v1.0rc1"
   xmlns:tns="http://www.ivoa.net/wsdl/CEA/REST/v1.0rc1"
   xmlns:ceab="http://www.ivoa.net/xml/CEA/base/v1.0rc1"
   xmlns:ceat="http://www.ivoa.net/xml/CEA/types/v1.0rc1"
   xmlns:wsoap="http://www.w3.org/ns/wsdl/soap"
   xmlns:whttp="http://www.w3.org/ns/wsdl/http"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xsi:schemaLocation="http://www.w3.org/ns/wsdl ../wsdl20.xsd
                            http://www.w3.org/ns/wsdl/http ../http.xsd
                            ">
   <!--  original      xsi:schemaLocation="http://www.w3.org/ns/wsdl http://www.w3.org/2002/ws/desc/ns/wsdl20.xsd
      http://www.w3.org/ns/wsdl/http http://www.w3.org/2002/ws/desc/ns/http.xsd
      
   -->
   <documentation>
      This describes the REST style interface for the UWS-PA pattern
      using the CEA
   </documentation>
   <types>
     <xs:schema targetNamespace="http://www.ivoa.net/wsdl/CEA/REST/v1.0rc1"> <!-- should we choose a different namespace? -->
      <xs:import namespace="http://www.ivoa.net/xml/CEA/base/v1.0rc2"
         schemaLocation="../v11/CEABase.xsd" />
      <xs:import namespace="http://www.ivoa.net/xml/CEA/types/v1.0rc1"
         schemaLocation="CEATypes.xsd" />
         
    <xs:element name="createJob" type="ceat:CreateJob">
   </xs:element>
   <xs:element name="createJobResponse">
      <xs:complexType>
         <xs:sequence>
            <xs:element ref="ceat:jobId"></xs:element>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   <xs:element name="execute">
      <xs:complexType>
      <xs:sequence><xs:element name="phase" type="ceat:execution-phase"></xs:element></xs:sequence>
      </xs:complexType>
   </xs:element>
   <xs:element name="listJobsResponse">
      <xs:complexType>
         <xs:sequence>
            <xs:element  name="job" type="tns:shortJobDescription" maxOccurs="unbounded"></xs:element>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   <xs:element name="getPhaseResponse" type="ceat:message-type"></xs:element>
   <xs:element name="SetTerminationTime"></xs:element>
   <xs:element name="SetTerminationTimeResponse"></xs:element>
   <xs:element name="root">
      <xs:complexType>
         <xs:sequence>
            <xs:any maxOccurs="unbounded"></xs:any>
         </xs:sequence>
      </xs:complexType>
   </xs:element>


   <xs:complexType name="shortJobDescription">
      <xs:attribute name="id" type="xs:string" use="required"></xs:attribute>
        <xs:attributeGroup ref="tns:reference"></xs:attributeGroup>
    </xs:complexType>
    
    
   
  <xs:attributeGroup name="reference">
    <xs:annotation>
      <xs:documentation>standard xlink references</xs:documentation>
    </xs:annotation>
    <xs:attribute ref="xlink:type" use="optional" default="simple"/>
    <xs:attribute ref="xlink:href" use="optional"/>
  </xs:attributeGroup>
   

  <xs:element name="getResultsResponse" type="ceat:result-list-type"></xs:element>

  <xs:element name="getExecutionSummaryResponse"
     type="ceat:execution-summary-type">
  </xs:element>
       </xs:schema>
   </types>
   <interface name="UWS-PA">
      <operation name="createJob"
         pattern="http://www.w3.org/ns/wsdl/in-out">
         <input messageLabel="In" element="tns:CreateJob"  />
         <output messageLabel="Out"
            element="tns:createJobResponse" />
      </operation>
     <operation name="setTerminationTime"
         pattern="http://www.w3.org/ns/wsdl/in-out">
         <input messageLabel="In" element="tns:SetTerminationTime"  />
         <output messageLabel="Out"
            element="tns:SetTerminationTimeResponse" />
      </operation>
       <operation name="listJobs"
         pattern="http://www.w3.org/ns/wsdl/in-out">
         <input messageLabel="In" element="#none" />
         <output messageLabel="Out"
            element="tns:listJobsResponse" />
      </operation>
      <operation name="listJobDetail"
         pattern="http://www.w3.org/ns/wsdl/in-out">
         <input messageLabel="In" element="#none" />
         <output messageLabel="Out"
            element="tns:listJobDetailResponse" />
      </operation>
      <!-- intention is to post this to the phase endpoint -->
      <operation name="execute" 
         pattern="http://www.w3.org/ns/wsdl/in-out">
          <input messageLabel="In" element="ceat:phase" />
         <output messageLabel="Out"
            element="ceat:phase" />        
      </operation>
     <operation name="getPhase" 
         pattern="http://www.w3.org/ns/wsdl/in-out">
          <input messageLabel="In" element="#none" />
         <output messageLabel="Out"
            element="ceat:phase" />        
      </operation>
     <operation name="getResults" 
         pattern="http://www.w3.org/ns/wsdl/in-out">
          <input messageLabel="In" element="#none" />
         <output messageLabel="Out"
            element="tns:getResultsResponse" />        
      </operation>
     <operation name="getExecutionSummary" 
         pattern="http://www.w3.org/ns/wsdl/in-out">
          <input messageLabel="In" element="#none" />
         <output messageLabel="Out"
            element="tns:getExecutionSummaryResponse" />        
      </operation>
     <operation name="delete" <!-- want to do with a delete http call -->
         pattern="http://www.w3.org/ns/wsdl/in-out">
         <input messageLabel="In" element="#none" />
         <output messageLabel="Out"
            element="tns:deleteResponse" />        
      </operation>
           
   </interface>
   <binding name="CEARESTBinding"
      interface="tns:reservationDetailsInterface"
      type="http://www.w3.org/ns/wsdl/soap"
      wsoap:protocol="http://www.w3.org/2003/05/soap/bindings/HTTP/">
      <operation ref="tns:createJob" whttp:location="./jobs"
         wsoap:mep="http://www.w3.org/2003/05/soap/mep/request-response"  >
         
         </operation>
         <!-- the curly braces notation is supposed to allow the processor to find the relevant 
         data item in the input data to build the correct URL - this however implies that the 
         message must include that element, which makes it a little pointless... perhaps the intention is that the 
         client-side toolkit will strip this off and automatically route to the correct endopoint.
         see section 2.5.6 of wsdl 2 primer for more information.-->
      <operation ref="tns:getResults" whttp:location="./jobs/{jobId}/results"
         wsoap:mep="http://www.w3.org/2003/05/soap/mep/request-response" />
      <operation ref="tns:setTerminationTime" whttp:location="./jobs/{jobId}/termination"
         wsoap:mep="http://www.w3.org/2003/05/soap/mep/request-response" />
      <operation ref="tns:listJobs" whttp:location="./jobs"
         wsoap:mep="http://www.w3.org/2003/05/soap/mep/request-response" />
      <operation ref="tns:listJobDetail" whttp:location="./jobs/{jobId}"
         wsoap:mep="http://www.w3.org/2003/05/soap/mep/request-response" />
      <operation ref="tns:execute" whttp:location="./jobs/{jobId}/phase"
         wsoap:mep="http://www.w3.org/2003/05/soap/mep/request-response" />
      <operation ref="tns:getPhase" whttp:location="./jobs/{jobId}/phase"
         wsoap:mep="http://www.w3.org/2003/05/soap/mep/request-response" />
      <operation ref="tns:getExecutionSummary" whttp:location="./jobs/{jobId}"
         wsoap:mep="http://www.w3.org/2003/05/soap/mep/request-response" />
         <!-- use the DELETE method for the delete operation -->
     <operation ref="tns:delete" whttp:location="./jobs/{jobId}"
          whttp:method="DELETE"
         wsoap:mep="http://www.w3.org/2003/05/soap/mep/request-response"
          />
       
         
   </binding>
</description>
