<?xml version="1.0" encoding="UTF-8"?>

<!--
/*
 * Copyright 1999-2006 University of Chicago
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy
 * of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */
 -->

<!-- non processed WSDL, see copyToDeployableComponent ant target -->

<wsdl:definitions name="WorkspaceFactoryService"
    targetNamespace="http://www.globus.org/2007/08/workspace"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:wsdlpp="http://www.globus.org/namespaces/2004/10/WSDLPreprocessor"
    xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd"
    xmlns:wsrpw="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
    xmlns:wsnt="http://docs.oasis-open.org/wsn/2004/06/wsn-WS-BaseNotification-1.2-draft-01.xsd"
    xmlns:wsbf="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-BaseFaults-1.2-draft-01.xsd"
    xmlns:tns="http://www.globus.org/2007/08/workspace"
    xmlns:work-types="http://www.globus.org/2007/08/workspace/types" >

    <wsdl:import
        namespace="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.wsdl"
        location="../wsrf/properties/WS-ResourceProperties.wsdl" />

    <wsdl:types>
        <xs:schema
            targetNamespace="http://www.globus.org/2007/08/workspace"
            xmlns:tns="http://www.globus.org/2007/08/workspace"
            elementFormDefault="qualified"
            xmlns:def="http://www.globus.org/2007/08/workspace/metadata/definition"
            xmlns:jsdl="http://schemas.ggf.org/jsdl/2005/11/jsdl" >

            <xs:import
                namespace="http://www.globus.org/2007/08/workspace/types"
                schemaLocation="./workspace_types.xsd" />

            <xs:import
                namespace="http://schemas.ggf.org/jsdl/2005/11/jsdl"
                schemaLocation="./jsdl/jsdl.xsd" />

            <xs:import
                namespace="http://www.globus.org/2007/08/workspace/metadata/definition"
                schemaLocation="./metadata/vw-definition.xsd" />

            <!--==================================================-->
            <!--               Resource properties                -->
            <!--==================================================-->

            <!-- TODO: should contain more information pertinent to resource
                 request.  Agreement templates etc. -->

            <xs:element name="FactoryRPSet">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element ref="work-types:DefaultRunningTime" />
                        <xs:element ref="work-types:MaximumRunningTime" />
                        <xs:element ref="jsdl:CPUArchitectureName"
                                    minOccurs="0" />
                        <xs:element ref="def:VMM"
                                    minOccurs="0" />
                        <xs:element ref="work-types:Associations"
                                    minOccurs="0" />
                    </xs:sequence>
                </xs:complexType>
            </xs:element>


            <!--==================================================-->
            <!--    Operational input/output type declarations    -->
            <!--==================================================-->

            <xs:element name="create"
                        type="work-types:WorkspaceCreateRequest_Type" />

            <xs:element name="createResponse"
                        type="work-types:WorkspaceCreateResponse_Type" />

        </xs:schema>
    </wsdl:types>


    <!--==================================================-->
    <!--            Message declarations                  -->
    <!--==================================================-->

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

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

    <!-- messages for faults: -->

    <wsdl:message  name="CreationFaultMsg">
        <wsdl:part name="description"
                   element="work-types:WorkspaceCreationFault" />
    </wsdl:message>

    <wsdl:message  name="SchedulingFaultMsg">
        <wsdl:part name="description"
                   element="work-types:WorkspaceSchedulingFault" />
    </wsdl:message>

    <wsdl:message  name="MetadataFaultMsg">
        <wsdl:part name="description"
                   element="work-types:WorkspaceMetadataFault" />
    </wsdl:message>

    <wsdl:message  name="ResourceRequestDeniedFaultMsg">
        <wsdl:part name="description"
                   element="work-types:WorkspaceResourceRequestDeniedFault" />
    </wsdl:message>

    <!--==================================================-->
    <!--            portType declaration                  -->
    <!--==================================================-->

    <wsdl:portType name="WorkspaceFactoryPortType"
        wsrp:ResourceProperties="tns:FactoryRPSet"
        wsdlpp:extends="	wsrpw:GetResourceProperty
                            wsrpw:GetMultipleResourceProperties
                            wsrpw:QueryResourceProperties">

        <wsdl:operation  name="create">

            <wsdl:input  message="tns:CreateInputMessage" />
            <wsdl:output message="tns:CreateOutputMessage" />

            <wsdl:fault  name="WorkspaceCreationFault"
                         message="tns:CreationFaultMsg" />

            <wsdl:fault  name="WorkspaceSchedulingFault"
                         message="tns:SchedulingFaultMsg" />

            <wsdl:fault  name="WorkspaceMetadataFault"
                         message="tns:MetadataFaultMsg" />

            <wsdl:fault  name="WorkspaceResourceRequestDeniedFault"
                         message="tns:ResourceRequestDeniedFaultMsg" />

        </wsdl:operation>

    </wsdl:portType>

</wsdl:definitions>
