<definitions name="orderingService"
  targetNamespace="http://orchestra.ow2.org/demos/orderingService"
  xmlns:tns="http://orchestra.ow2.org/demos/orderingService"
  xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
  xmlns="http://schemas.xmlsoap.org/wsdl/"
  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns:vprop="http://docs.oasis-open.org/wsbpel/2.0/varprop">

  <plnk:partnerLinkType name="initPLT">
    <plnk:role name="init" portType="tns:initPT" />
  </plnk:partnerLinkType>
  <plnk:partnerLinkType name="orderPLT">
    <plnk:role name="order" portType="tns:orderPT" />
  </plnk:partnerLinkType>
  <plnk:partnerLinkType name="validatePLT">
    <plnk:role name="validate" portType="tns:validatePT" />
  </plnk:partnerLinkType>

  <types>
    <schema attributeFormDefault="unqualified"
      elementFormDefault="qualified"
      targetNamespace="http://orchestra.ow2.org/demos/orderingService"
      xmlns="http://www.w3.org/2001/XMLSchema">

      <element name="initInfo">
        <complexType>
          <sequence>
            <element name="id" type="int" />
            <element name="clientName" type="string" />
            <element name="sessionExpiration" type="string" />
          </sequence>
        </complexType>
      </element>

      <element name="orderInfo">
        <complexType>
          <sequence>
            <element name="id" type="int" />
            <element name="productName" type="string" />
          </sequence>
        </complexType>
      </element>

      <element name="validateInfo">
        <complexType>
          <sequence>
            <element name="id" type="int" />
          </sequence>
        </complexType>
      </element>

      <element name="response">
        <complexType>
          <sequence>
            <element name="id" type="int" />
            <element name="result" type="string" />
          </sequence>
        </complexType>
      </element>

    </schema>
  </types>

  <vprop:property name="idProp" type="xsd:int" />
  <vprop:propertyAlias messageType="tns:initMsg" part="initInfo"
    propertyName="tns:idProp">
    <vprop:query><![CDATA[tns:id/text()]]></vprop:query>
  </vprop:propertyAlias>
  <vprop:propertyAlias messageType="tns:orderMsg" part="orderInfo"
    propertyName="tns:idProp">
    <vprop:query><![CDATA[tns:id/text()]]></vprop:query>
  </vprop:propertyAlias>
  <vprop:propertyAlias messageType="tns:validateMsg" part="validateInfo"
    propertyName="tns:idProp">
    <vprop:query><![CDATA[tns:id/text()]]></vprop:query>
  </vprop:propertyAlias>
  <vprop:propertyAlias messageType="tns:purchaseResponse" part="result"
    propertyName="tns:idProp">
    <vprop:query><![CDATA[tns:id/text()]]></vprop:query>
  </vprop:propertyAlias>

  <message name="initMsg">
    <part name="initInfo" element="tns:initInfo" />
  </message>

  <message name="orderMsg">
    <part name="orderInfo" element="tns:orderInfo" />
  </message>

  <message name="validateMsg">
    <part name="validateInfo" element="tns:validateInfo" />
  </message>

  <message name="purchaseResponse">
    <part name="result" element="tns:response" />
  </message>

  <portType name="initPT">
    <operation name="init">
      <input message="tns:initMsg" />
      <output message="tns:purchaseResponse" />
    </operation>
  </portType>

  <portType name="orderPT">
    <operation name="order">
      <input message="tns:orderMsg" />
    </operation>
  </portType>

  <portType name="validatePT">
    <operation name="validate">
      <input message="tns:validateMsg" />
    </operation>
  </portType>

  <binding name="initPTSOAPBinding" type="tns:initPT">
    <soap:binding style="document"
      transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="init">
      <soap:operation
        soapAction="http://orchestra.ow2.org/demos/orderingService/init" />
      <input>
        <soap:body use="literal" />
      </input>
      <output>
        <soap:body use="literal" />
      </output>
    </operation>
  </binding>

  <binding name="orderPTSOAPBinding" type="tns:orderPT">
    <soap:binding style="document"
      transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="order">
      <soap:operation
        soapAction="http://orchestra.ow2.org/demos/orderingService/order" />
      <input>
        <soap:body use="literal" />
      </input>
    </operation>
  </binding>

  <binding name="validatePTSOAPBinding" type="tns:validatePT">
    <soap:binding style="document"
      transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="validate">
      <soap:operation
        soapAction="http://orchestra.ow2.org/demos/orderingService/validate" />
      <input>
        <soap:body use="literal" />
      </input>
    </operation>
  </binding>

  <service name="initService">
    <port name="initPort" binding="tns:initPTSOAPBinding">
      <soap:address location="http://localhost:${HttpDefaultPort}/orchestra/initPort" />
    </port>
  </service>

  <service name="orderService">
    <port name="orderPort" binding="tns:orderPTSOAPBinding">
      <soap:address
        location="http://localhost:${HttpDefaultPort}/orchestra/orderPort" />
    </port>
  </service>

  <service name="validateService">
    <port name="validatePort" binding="tns:validatePTSOAPBinding">
      <soap:address
        location="http://localhost:${HttpDefaultPort}/orchestra/validatePort" />
    </port>
  </service>

</definitions>
