<?xml version="1.0" encoding="UTF-8"?>
<!-- 
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you 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.
 -->
<wsdl:definitions name="DoubleIt" 
   xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns:tns="http://cxf.apache.org/policytest/DoubleIt"
   targetNamespace="http://cxf.apache.org/policytest/DoubleIt"
   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" 
   xmlns:wsaws="http://www.w3.org/2005/08/addressing" 
   xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy" 
   xmlns:wspp="http://java.sun.com/xml/ns/wsit/policy">
   <wsdl:types>
      <xsd:schema targetNamespace="http://cxf.apache.org/policytest/DoubleIt">
         <xsd:element name="DoubleIt">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="numberToDouble" type="xsd:integer"/>
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <xsd:element name="DoubleItResponse">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="doubledNumber" type="xsd:integer" />
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
      </xsd:schema>
   </wsdl:types>
   <wsdl:message name="DoubleItRequest">
      <wsdl:part element="tns:DoubleIt" name="parameters" />
   </wsdl:message>
   <wsdl:message name="DoubleItResponse">
      <wsdl:part element="tns:DoubleItResponse" name="parameters" />
   </wsdl:message>
   <wsdl:portType name="DoubleItPortType">
      <wsdl:operation name="DoubleIt">
         <wsdl:input message="tns:DoubleItRequest" />
         <wsdl:output message="tns:DoubleItResponse" />
      </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="DoubleItBinding" type="tns:DoubleItPortType">
      <wsp:PolicyReference URI="#DoubleItBindingPolicy"/>
      <soap:binding style="document"
         transport="http://schemas.xmlsoap.org/soap/http" />
      <wsdl:operation name="DoubleIt">
         <soap:operation soapAction=""/>
         <wsdl:input><soap:body use="literal"/></wsdl:input>
         <wsdl:output><soap:body use="literal"/></wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:binding name="DoubleItBindingEncryptThenSign" type="tns:DoubleItPortType">
      <wsp:PolicyReference URI="#DoubleItEncryptThenSignPolicy"/>
      <soap:binding style="document"
         transport="http://schemas.xmlsoap.org/soap/http" />
      <wsdl:operation name="DoubleIt">
         <soap:operation soapAction=""/>
         <wsdl:input><soap:body use="literal"/></wsdl:input>
         <wsdl:output><soap:body use="literal"/></wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:binding name="DoubleItBindingSignThenEncrypt" type="tns:DoubleItPortType">
      <wsp:PolicyReference URI="#DoubleItSignThenEncryptPolicy"/>
      <soap:binding style="document"
         transport="http://schemas.xmlsoap.org/soap/http" />
      <wsdl:operation name="DoubleIt">
         <soap:operation soapAction=""/>
         <wsdl:input><soap:body use="literal"/></wsdl:input>
         <wsdl:output><soap:body use="literal"/></wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:binding name="DoubleItBindingSign" type="tns:DoubleItPortType">
      <wsp:PolicyReference URI="#DoubleItSignPolicy"/>
      <soap:binding style="document"
         transport="http://schemas.xmlsoap.org/soap/http" />
      <wsdl:operation name="DoubleIt">
         <soap:operation soapAction=""/>
         <wsdl:input><soap:body use="literal"/></wsdl:input>
         <wsdl:output><soap:body use="literal"/></wsdl:output>
      </wsdl:operation>
   </wsdl:binding>
   <wsdl:service name="DoubleItService">
      <wsdl:port name="DoubleItPortHttps" binding="tns:DoubleItBinding">
         <soap:address 
            location="https://localhost:9009/SecPolTest"/>
      </wsdl:port>
      <wsdl:port name="DoubleItPortHttp" binding="tns:DoubleItBinding">
         <soap:address 
            location="http://localhost:9010/SecPolTest"/>
      </wsdl:port>
      <wsdl:port name="DoubleItPortEncryptThenSign" binding="tns:DoubleItBindingEncryptThenSign">
         <soap:address 
            location="http://localhost:9010/SecPolTestEncryptThenSign"/>
      </wsdl:port>
      <wsdl:port name="DoubleItPortSignThenEncrypt" binding="tns:DoubleItBindingSignThenEncrypt">
         <soap:address 
            location="http://localhost:9010/SecPolTestSignThenEncrypt"/>
      </wsdl:port>
      <wsdl:port name="DoubleItPortSign" binding="tns:DoubleItBindingSign">
         <soap:address 
            location="http://localhost:9010/SecPolTestSign"/>
      </wsdl:port>
   </wsdl:service>
   
   <wsp:Policy wsu:Id="DoubleItBindingPolicy">
      <wsp:ExactlyOne>
         <wsp:All>
            <foo:unknownPolicy xmlns:foo="http://cxf.apache.org/not/a/policy"/>
         </wsp:All>
         <wsp:All>
            <wsaws:UsingAddressing xmlns:wsaws="http://www.w3.org/2006/05/addressing/wsdl"/>
            <sp:TransportBinding>
               <wsp:Policy>
                  <sp:TransportToken>
                     <wsp:Policy>
                        <sp:HttpsToken RequireClientCertificate="false"/>
                     </wsp:Policy>
                  </sp:TransportToken>
                  <sp:Layout>
                     <wsp:Policy>
                        <sp:Lax/>
                     </wsp:Policy>
                  </sp:Layout>
                  <sp:IncludeTimestamp/>
                  <sp:AlgorithmSuite>
                     <wsp:Policy>
                        <sp:Basic128/>
                     </wsp:Policy>
                  </sp:AlgorithmSuite>
               </wsp:Policy>
            </sp:TransportBinding>
            <sp:Wss10>
               <wsp:Policy>
                  <sp:MustSupportRefKeyIdentifier/>
               </wsp:Policy>
            </sp:Wss10>
            <sp:SignedSupportingTokens>
               <wsp:Policy>
                  <sp:UsernameToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
                     <wsp:Policy>
                        <sp:WssUsernameToken10/>
                     </wsp:Policy>
                  </sp:UsernameToken>
               </wsp:Policy>
            </sp:SignedSupportingTokens>
         </wsp:All>
      </wsp:ExactlyOne>
   </wsp:Policy>
  <wsp:Policy wsu:Id="DoubleItEncryptThenSignPolicy">
    <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:IncludeTimestamp/>
            <sp:EncryptSignature/>
            <sp:OnlySignEntireHeadersAndBody/>
            <sp:EncryptBeforeSigning/>
          </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:MustSupportRefKeyIdentifier/-->
            <sp:MustSupportRefIssuerSerial/>
          </wsp:Policy>
        </sp:Wss10>
      </wsp:All>
    </wsp:ExactlyOne>
  </wsp:Policy>
  <wsp:Policy wsu:Id="DoubleItSignThenEncryptPolicy">
    <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:IncludeTimestamp/>
            <sp:EncryptSignature/>
            <sp:OnlySignEntireHeadersAndBody/>
            <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:MustSupportRefKeyIdentifier/-->
            <sp:MustSupportRefIssuerSerial/>
          </wsp:Policy>
        </sp:Wss10>
      </wsp:All>
    </wsp:ExactlyOne>
  </wsp:Policy>
  
  
  <wsp:Policy wsu:Id="DoubleItSignPolicy"
    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:WssX509V3Token10 />
                                </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/Always'>
                                <wsp:Policy>
                                    <sp:WssX509V3Token10 />
                                </wsp:Policy>
                            </sp:X509Token>
                        </wsp:Policy>
                    </sp:RecipientToken>
                    <sp:AlgorithmSuite>
                        <wsp:Policy>
                            <sp:Basic256 />
                        </wsp:Policy>
                    </sp:AlgorithmSuite>
                    <sp:Layout>
                        <wsp:Policy>
                            <sp:Strict />
                        </wsp:Policy>
                    </sp:Layout>
                    <sp:OnlySignEntireHeadersAndBody />
                </wsp:Policy>
            </sp:AsymmetricBinding>
            <sp:Wss10 xmlns:sp='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy'>
                <wsp:Policy>
                    <sp:MustSupportRefEmbeddedToken />
                </wsp:Policy>
            </sp:Wss10>
            <sp:SignedParts xmlns:sp='http://schemas.xmlsoap.org/ws/2005/07/securitypolicy'>
                <sp:Body />
            </sp:SignedParts>
        </wsp:All>
    </wsp:ExactlyOne>
</wsp:Policy>
  
</wsdl:definitions>
