<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<definitions 
    targetNamespace="urn:switchyard-quickstart-demo:policy-security-wss-signencrypt:0.1.0" 
    xmlns="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:tns="urn:switchyard-quickstart-demo:policy-security-wss-signencrypt:0.1.0"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:wsp="http://www.w3.org/ns/ws-policy"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    
  <types>
    <xsd:schema 
        targetNamespace="urn:switchyard-quickstart-demo:policy-security-wss-signencrypt:0.1.0" 
        xmlns:tns="urn:switchyard-quickstart-demo:policy-security-wss-signencrypt:0.1.0" 
        xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xs:element name="doWork" type="tns:doWorkType"/>
        <xs:element name="doWorkResponse" type="tns:doWorkResponseType"/>
        <xs:element name="work" type="tns:workType"/>
        <xs:element name="workAck" type="tns:workAckType"/>
        <xs:complexType name="doWorkType">
            <xs:sequence>
                <xs:element name="work" type="tns:workType"/>
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="doWorkResponseType">
            <xs:sequence>
                <xs:element name="workAck" type="tns:workAckType"/>
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="workType">
            <xs:sequence>
                <xs:element name="command" type="xs:string"/>
            </xs:sequence>
        </xs:complexType>
        <xs:complexType name="workAckType">
            <xs:sequence>
                <xs:element name="command" type="xs:string"/>
                <xs:element name="received" type="xs:boolean"/>
            </xs:sequence>
        </xs:complexType>
    </xsd:schema>
  </types>
  
  <message name="doWork">
    <part name="parameters" element="tns:doWork"/>
  </message>
  <message name="doWorkResponse">
    <part name="parameters" element="tns:doWorkResponse"/>
  </message>
  
  <portType name="WorkService">
    <operation name="doWork">
      <input message="tns:doWork"/>
      <output message="tns:doWorkResponse"/>
    </operation>
  </portType>
  
  <binding name="WorkServiceBinding" type="tns:WorkService">
    <wsp:PolicyReference URI="#WorkServicePolicy"/>
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="doWork">
      <soap:operation soapAction="urn:switchyard-quickstart-demo:policy-security-wss-signencrypt:0.1.0"/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
  </binding>

  <wsp:Policy wsu:Id="WorkServicePolicy" xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
    <wsp:ExactlyOne>
      <wsp:All>
        <sp:AsymmetricBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
          <wsp:Policy>
            <sp:InitiatorToken>
              <wsp:Policy>
                <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
                  <wsp:Policy>
                    <sp:WssX509V1Token11/>
                  </wsp:Policy>
                  </sp:X509Token>
              </wsp:Policy>
            </sp:InitiatorToken>
            <sp:RecipientToken>
              <wsp:Policy>
                <sp:X509Token sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
                  <wsp:Policy>
                    <sp:WssX509V1Token11/>
                  </wsp:Policy>
                </sp:X509Token>
              </wsp:Policy>
            </sp:RecipientToken>
            <sp:AlgorithmSuite>
              <wsp:Policy>
                <sp:TripleDesRsa15/>
              </wsp:Policy>
            </sp:AlgorithmSuite>
            <sp:Layout>
              <wsp:Policy>
                <sp:Lax/>
              </wsp:Policy>
            </sp:Layout>
            <sp:SignBeforeEncrypting/>
          </wsp:Policy>
        </sp:AsymmetricBinding>
        <sp:SignedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
          <sp:Body/>
        </sp:SignedParts>
        <sp:EncryptedParts xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
          <sp:Body/>
        </sp:EncryptedParts>
        <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
          <wsp:Policy>
            <sp:MustSupportRefIssuerSerial/>
          </wsp:Policy>
        </sp:Wss10>
      </wsp:All>
    </wsp:ExactlyOne>
  </wsp:Policy>

  <service name="WorkService">
    <port name="WorkServicePort" binding="tns:WorkServiceBinding">
      <soap:address location="https://localhost:8443/WorkService/WorkService"/>
    </port>
  </service>
</definitions>

