<wsdl:definitions name="BESFactory"
    targetNamespace="http://schemas.ggf.org/bes/2006/08/bes-factory"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:bes-factory="http://schemas.ggf.org/bes/2006/08/bes-factory"
    xmlns:wsa="http://www.w3.org/2005/08/addressing"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:hpcpbf="http://schemas.ogf.org/hpcp/2007/01/bp/BasicFilter" >

 
  <wsdl:types>
    <xsd:schema
        xmlns:wsa="http://www.w3.org/2005/08/addressing"
	xmlns:hpcpbf="http://schemas.ogf.org/hpcp/2007/01/bp/BasicFilter"
        attributeFormDefault="unqualified"
        elementFormDefault="qualified"
        targetNamespace="http://schemas.ggf.org/bes/2006/08/bes-factory">

      <xsd:include schemaLocation="./bes-factory.xsd"/>

      <xsd:import
               namespace="http://schemas.ogf.org/hpcp/2007/01/bp/BasicFilter"
               schemaLocation="./hpc-profile-basicfilter.xsd" />

      <xsd:import
               namespace="http://www.w3.org/2005/08/addressing"
               schemaLocation="./ws-addr.xsd"/>
        
      <!-- Message Types -->
      <xsd:complexType name="CreateActivityType">
        <xsd:sequence>
          <xsd:element ref="bes-factory:ActivityDocument"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>        
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <xsd:complexType name="CreateActivityResponseType">
        <xsd:sequence>
          <xsd:element name="ActivityIdentifier" type="wsa:EndpointReferenceType"/>
          <xsd:element ref="bes-factory:ActivityDocument" minOccurs="0"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>        
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <xsd:complexType name="GetActivityStatusesType">
        <xsd:sequence>
          <xsd:element name="ActivityIdentifier" type="wsa:EndpointReferenceType" maxOccurs="unbounded" minOccurs="0"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>        
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <xsd:complexType name="GetActivityStatusesResponseType">
        <xsd:sequence>
          <xsd:element name="Response" type="bes-factory:GetActivityStatusResponseType" maxOccurs="unbounded" minOccurs="0"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>        
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <xsd:complexType name="TerminateActivitiesType">
        <xsd:sequence>
          <xsd:element name="ActivityIdentifier" type="wsa:EndpointReferenceType" minOccurs="0" maxOccurs="unbounded"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>        
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <xsd:complexType name="TerminateActivitiesResponseType">
        <xsd:sequence>
          <xsd:element name="Response" type="bes-factory:TerminateActivityResponseType" minOccurs="0" maxOccurs="unbounded"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>        
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <xsd:complexType name="GetActivityDocumentsType">
        <xsd:sequence>
          <xsd:element name="ActivityIdentifier" type="wsa:EndpointReferenceType" minOccurs="0" maxOccurs="unbounded"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>        
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <xsd:complexType name="GetActivityDocumentsResponseType">
        <xsd:sequence>
          <xsd:element name="Response" type="bes-factory:GetActivityDocumentResponseType" minOccurs="0" maxOccurs="unbounded"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>        
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <xsd:complexType name="GetFactoryAttributesDocumentType">
        <xsd:sequence>
          <xsd:element ref="hpcpbf:BasicFilter"  />
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <xsd:complexType name="GetFactoryAttributesDocumentResponseType">
        <xsd:sequence>
          <xsd:element ref="bes-factory:FactoryResourceAttributesDocument"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <!-- Fault Types  -->
      <xsd:complexType name="NotAuthorizedFaultType">
        <xsd:sequence>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>
      
      <xsd:complexType name="NotAcceptingNewActivitiesFaultType">
        <xsd:sequence>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <xsd:complexType name="UnsupportedFeatureFaultType">
        <xsd:sequence>
          <xsd:element name="Feature" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>
      
      <xsd:complexType name="CantApplyOperationToCurrentStateFaultType">
        <xsd:sequence>
          <xsd:element name="ActivityStatus" type="bes-factory:ActivityStatusType" />
          <xsd:element name="Message" type="xsd:string"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <xsd:complexType name="OperationWillBeAppliedEventuallyFaultType">
        <xsd:sequence>
          <xsd:element name="ActivityStatus" type="bes-factory:ActivityStatusType" />
          <xsd:element name="Message" type="xsd:string"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>
      
      <xsd:complexType name="UnknownActivityIdentifierFaultType">
        <xsd:sequence>
          <xsd:element name="Message" type="xsd:string"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>
      
      <xsd:complexType name="InvalidRequestMessageFaultType">
        <xsd:sequence>
          <xsd:element name="InvalidElement" type="xsd:string" minOccurs="0" maxOccurs ="unbounded"/>
          <xsd:element name="Message" type="xsd:string"/>
          <xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:anyAttribute namespace="##other" processContents="lax"/>
      </xsd:complexType>

      <!-- Message Elements -->
      <xsd:element name="CreateActivity"
        type="bes-factory:CreateActivityType"/>
      <xsd:element name="CreateActivityResponse"
        type="bes-factory:CreateActivityResponseType"/>
      <xsd:element name="GetActivityStatuses"
        type="bes-factory:GetActivityStatusesType"/>
      <xsd:element name="GetActivityStatusesResponse"
        type="bes-factory:GetActivityStatusesResponseType"/>
      <xsd:element name="TerminateActivities"
        type="bes-factory:TerminateActivitiesType"/>
      <xsd:element name="TerminateActivitiesResponse"
        type="bes-factory:TerminateActivitiesResponseType"/>
      <xsd:element name="GetActivityDocuments"
        type="bes-factory:GetActivityDocumentsType"/>
      <xsd:element name="GetActivityDocumentsResponse"
        type="bes-factory:GetActivityDocumentsResponseType"/>
      <xsd:element name="GetFactoryAttributesDocument"
        type="bes-factory:GetFactoryAttributesDocumentType"/>
      <xsd:element name="GetFactoryAttributesDocumentResponse"
        type="bes-factory:GetFactoryAttributesDocumentResponseType"/>

      <!-- Fault Elements -->
      <xsd:element name="NotAuthorizedFault"
        type="bes-factory:NotAuthorizedFaultType"/>
      <xsd:element name="NotAcceptingNewActivitiesFault"
        type="bes-factory:NotAcceptingNewActivitiesFaultType"/>
      <xsd:element name="UnsupportedFeatureFault"
        type="bes-factory:UnsupportedFeatureFaultType"/>
      <xsd:element name="CantApplyOperationToCurrentStateFault"
        type="bes-factory:CantApplyOperationToCurrentStateFaultType"/>
      <xsd:element name="OperationWillBeAppliedEventuallyFault"
        type="bes-factory:OperationWillBeAppliedEventuallyFaultType"/>
      <xsd:element name="UnknownActivityIdentifierFault"
        type="bes-factory:UnknownActivityIdentifierFaultType"/>
      <xsd:element name="InvalidRequestMessageFault"
        type="bes-factory:InvalidRequestMessageFaultType"/>
    </xsd:schema>
  </wsdl:types>

  <!-- Messages -->
  <wsdl:message name="CreateActivityRequest">
    <wsdl:part name="parameters"
        element="bes-factory:CreateActivity"/>
  </wsdl:message>

  <wsdl:message name="CreateActivityResponse">
    <wsdl:part name="parameters"
        element="bes-factory:CreateActivityResponse"/>
  </wsdl:message>

  <wsdl:message name="GetActivityStatusesRequest">
    <wsdl:part name="parameters"
        element="bes-factory:GetActivityStatuses"/>
  </wsdl:message>

  <wsdl:message name="GetActivityStatusesResponse">
    <wsdl:part name="parameters"
        element="bes-factory:GetActivityStatusesResponse"/>
  </wsdl:message>

  <wsdl:message name="TerminateActivitiesRequest">
    <wsdl:part name="parameters"
        element="bes-factory:TerminateActivities"/>
  </wsdl:message>

  <wsdl:message name="TerminateActivitiesResponse">
    <wsdl:part name="parameters"
        element="bes-factory:TerminateActivitiesResponse"/>
  </wsdl:message>

  <wsdl:message name="GetActivityDocumentsRequest">
    <wsdl:part name="parameters"
        element="bes-factory:GetActivityDocuments"/>
  </wsdl:message>

  <wsdl:message name="GetActivityDocumentsResponse">
    <wsdl:part name="parameters"
        element="bes-factory:GetActivityDocumentsResponse"/>
  </wsdl:message>

  <wsdl:message name="GetFactoryAttributesDocumentRequest">
    <wsdl:part name="parameters"
        element="bes-factory:GetFactoryAttributesDocument"/>
  </wsdl:message>

  <wsdl:message name="GetFactoryAttributesDocumentResponse">
    <wsdl:part name="parameters"
        element="bes-factory:GetFactoryAttributesDocumentResponse"/>
  </wsdl:message>

  <!-- Fault Messages -->
  <wsdl:message name="NotAuthorizedFault">
    <wsdl:part name="Detail"
      element="bes-factory:NotAuthorizedFault"/>
  </wsdl:message>
  
  <wsdl:message name="NotAcceptingNewActivitiesFault">
    <wsdl:part name="Detail"
      element="bes-factory:NotAcceptingNewActivitiesFault"/>
  </wsdl:message>
  
  <wsdl:message name="UnsupportedFeatureFault">
    <wsdl:part name="Detail"
      element="bes-factory:UnsupportedFeatureFault"/>
  </wsdl:message>

  <wsdl:message name="CantApplyOperationToCurrentStateFault">
    <wsdl:part name="Detail" 
      element="bes-factory:CantApplyOperationToCurrentStateFault" />
  </wsdl:message>

  <wsdl:message name="OperationWillBeAppliedEventuallyFault">
    <wsdl:part name="Detail" 
      element="bes-factory:OperationWillBeAppliedEventuallyFault" />
  </wsdl:message>
  
  <wsdl:message name="UnknownActivityIdentifierFault">
    <wsdl:part name="Detail" 
      element="bes-factory:UnknownActivityIdentifierFault" />
  </wsdl:message>
  
  <wsdl:message name="InvalidRequestMessageFault">
    <wsdl:part name="Detail"
      element="bes-factory:InvalidRequestMessageFault" />
  </wsdl:message>

  <!-- Port Type -->
  <wsdl:portType name="BESFactoryPortType">

    <wsdl:operation name="CreateActivity">
      <wsdl:input 
         name="CreateActivity"
         message="bes-factory:CreateActivityRequest"  
         wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/CreateActivity"/>
      <wsdl:output
         name="CreateActivityResponse"
         message="bes-factory:CreateActivityResponse"
         wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/CreateActivityResponse"/>
      <wsdl:fault name="NotAuthorizedFault" 
        message="bes-factory:NotAuthorizedFault"
        wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/Fault"/>
      <wsdl:fault name="NotAcceptingNewActivitiesFault" 
         message="bes-factory:NotAcceptingNewActivitiesFault"
         wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/Fault"/>
      <wsdl:fault name="UnsupportedFeatureFault" 
         message="bes-factory:UnsupportedFeatureFault"
         wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/Fault"/>
      <wsdl:fault name="InvalidRequestMessageFault"
         message="bes-factory:InvalidRequestMessageFault"
         wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/Fault"/>
    </wsdl:operation>

    <wsdl:operation name="GetActivityStatuses">
      <wsdl:input
          name="GetActivityStatuses" 
          message="bes-factory:GetActivityStatusesRequest"
          wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/GetActivityStatuses"/>
      <wsdl:output
          name="GetActivityStatusesResponse" 
          message="bes-factory:GetActivityStatusesResponse"
          wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/GetActivityStatusesResponse"/>
      <wsdl:fault name="UnknownActivityIdentifierFault"
         message="bes-factory:UnknownActivityIdentifierFault"
         wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/Fault"/>
      <wsdl:fault name="NotAuthorizedFault"
        message="bes-factory:NotAuthorizedFault"
        wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/Fault"/>
    </wsdl:operation>

    <wsdl:operation name="TerminateActivities">
      <wsdl:input
          name="TerminateActivities" 
          message="bes-factory:TerminateActivitiesRequest"
          wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/TerminateActivities"/>
      <wsdl:output
          name="TerminateActivitiesResponse" 
          message="bes-factory:TerminateActivitiesResponse"
          wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/TerminateActivitiesResponse"/>
      <wsdl:fault name="UnknownActivityIdentifierFault"
         message="bes-factory:UnknownActivityIdentifierFault"
         wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/Fault"/>
      <wsdl:fault name="NotAuthorizedFault"
        message="bes-factory:NotAuthorizedFault"
        wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/Fault"/>
      <wsdl:fault name="CantApplyOperationToCurrentStateFault"
        message="bes-factory:CantApplyOperationToCurrentStateFault"
        wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/Fault"/>
    </wsdl:operation>

    <wsdl:operation name="GetActivityDocuments">
      <wsdl:input
          name="GetActivityDocuments" 
          message="bes-factory:GetActivityDocumentsRequest"
          wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/GetActivityDocuments"/>
      <wsdl:output
          name="GetActivityDocumentsResponse" 
          message="bes-factory:GetActivityDocumentsResponse"
          wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/GetActivityDocumentsResponse"/>
      <wsdl:fault name="UnknownActivityIdentifierFault"
         message="bes-factory:UnknownActivityIdentifierFault"
         wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/Fault"/>
      <wsdl:fault name="NotAuthorizedFault"
        message="bes-factory:NotAuthorizedFault"
        wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/Fault"/>
    </wsdl:operation>
 
    <wsdl:operation name="GetFactoryAttributesDocument">
      <wsdl:input
          name="GetFactoryAttributesDocument"
          message="bes-factory:GetFactoryAttributesDocumentRequest"
          wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/GetFactoryAttributesDocument"/>
      <wsdl:output
          name="GetFactoryAttributesDocumentResponse"
          message="bes-factory:GetFactoryAttributesDocumentResponse"
          wsa:Action="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/GetFactoryAttributesDocumentResponse"/>
    </wsdl:operation> 
  </wsdl:portType>

  <!-- Bindings -->
  <wsdl:binding name="BESFactoryBinding" type="bes-factory:BESFactoryPortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />

    <wsdl:operation name="CreateActivity">
      <soap:operation soapAction="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/CreateActivity" /> 
      <wsdl:input name="CreateActivity">
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output name="CreateActivityResponse">
        <soap:body use="literal" />
      </wsdl:output>
      <wsdl:fault name="NotAuthorizedFault">
        <soap:fault name="NotAuthorizedFault" use="literal" />
      </wsdl:fault>
      <wsdl:fault name="NotAcceptingNewActivitiesFault">
        <soap:fault name="NotAcceptingNewActivitiesFault" use="literal" />
      </wsdl:fault>
      <wsdl:fault name="UnsupportedFeatureFault">
        <soap:fault name="UnsupportedFeatureFault" use="literal" />
      </wsdl:fault>
      <wsdl:fault name="InvalidRequestMessageFault">
        <soap:fault name="InvalidRequestMessageFault" use="literal" />
      </wsdl:fault>
    </wsdl:operation> 

    <wsdl:operation name="GetActivityStatuses">
      <soap:operation soapAction="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/GetActivityStatuses" /> 
      <wsdl:input name="GetActivityStatuses">
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output name="GetActivityStatusesResponse">
        <soap:body use="literal" />
      </wsdl:output>
      <wsdl:fault name="UnknownActivityIdentifierFault">
        <soap:fault name="UnknownActivityIdentifierFault" use="literal" />
      </wsdl:fault>
      <wsdl:fault name="NotAuthorizedFault">
        <soap:fault name="NotAuthorizedFault" use="literal" />
      </wsdl:fault>
    </wsdl:operation>

    <wsdl:operation name="TerminateActivities">
      <soap:operation soapAction="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/TerminateActivities" /> 
      <wsdl:input name="TerminateActivities">
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output name="TerminateActivitiesResponse">
        <soap:body use="literal" />
      </wsdl:output>
      <wsdl:fault name="UnknownActivityIdentifierFault">
        <soap:fault name="UnknownActivityIdentifierFault" use="literal" />
      </wsdl:fault>
      <wsdl:fault name="NotAuthorizedFault">
        <soap:fault name="NotAuthorizedFault" use="literal" />
      </wsdl:fault>
      <wsdl:fault name="CantApplyOperationToCurrentStateFault">
        <soap:fault name="CantApplyOperationToCurrentStateFault" use="literal" />
      </wsdl:fault>
    </wsdl:operation>

    <wsdl:operation name="GetActivityDocuments">
      <soap:operation soapAction="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/GetActivityDocuments" /> 
      <wsdl:input name="GetActivityDocuments">
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output name="GetActivityDocumentsResponse">
        <soap:body use="literal" />
      </wsdl:output>
      <wsdl:fault name="UnknownActivityIdentifierFault">
        <soap:fault name="UnknownActivityIdentifierFault" use="literal" />
      </wsdl:fault>
      <wsdl:fault name="NotAuthorizedFault">
        <soap:fault name="NotAuthorizedFault" use="literal" />
      </wsdl:fault>
    </wsdl:operation>

    <wsdl:operation name="GetFactoryAttributesDocument">
      <soap:operation soapAction="http://schemas.ggf.org/bes/2006/08/bes-factory/BESFactoryPortType/GetFactoryAttributesDocument" /> 
      <wsdl:input name="GetFactoryAttributesDocument">
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output name="GetFactoryAttributesDocumentResponse">
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>

  <wsdl:service name="HPCBPService">
    <wsdl:port name="BESFactoryPort" binding="bes-factory:BESFactoryBinding">
      <soap:address location="https://HOSTNAME/HPCBasicProfile"/>
    </wsdl:port>
  </wsdl:service>

</wsdl:definitions> 

