<?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="HelloWorld" targetNamespace="http://apache.org/hello_world_soap_http" 
    xmlns="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:tns="http://apache.org/hello_world_soap_http"
    xmlns:x1="http://apache.org/hello_world_soap_http/types"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
    xmlns:wsp="http://www.w3.org/ns/ws-policy"
    xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata"
    xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"
    xmlns:t="http://docs.oasis-open.org/ws-sx/ws-trust/200512"
    xmlns:wsaw="http://www.w3.org/2005/08/addressing"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wsdl:types>
        <schema targetNamespace="http://apache.org/hello_world_soap_http/types" 
            xmlns="http://www.w3.org/2001/XMLSchema"
	    xmlns:tns="http://apache.org/hello_world_soap_http/types"
            elementFormDefault="qualified">

	    <simpleType name="MyStringType">
		<restriction base="string">
		    <maxLength value="30" />
		</restriction>
	    </simpleType>

            <element name="greetMe">
                <complexType>
                    <sequence>
                        <element name="requestType" type="tns:MyStringType"/>
                    </sequence>
                </complexType>
            </element>
            <element name="greetMeResponse">
                <complexType>
                    <sequence>
                        <element name="responseType" type="string"/>
                    </sequence>
                </complexType>
            </element>
        </schema>
    </wsdl:types>
    <wsdl:message name="greetMeRequest">
        <wsdl:part element="x1:greetMe" name="in"/>
    </wsdl:message>
    <wsdl:message name="greetMeResponse">
        <wsdl:part element="x1:greetMeResponse" name="out"/>
    </wsdl:message>
    
    <wsdl:portType name="Greeter">
        
        <wsdl:operation name="greetMe">
            <wsdl:input message="tns:greetMeRequest" name="greetMeRequest"/>
            <wsdl:output message="tns:greetMeResponse" name="greetMeResponse"/>
        </wsdl:operation>
        
    </wsdl:portType>
    
    <wsdl:binding name="Greeter_SOAPBinding" type="tns:Greeter">
        <wsp:PolicyReference URI="#AsymmetricSAML2Policy" />
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        
        <wsdl:operation name="greetMe">
            <soap:operation soapAction="" style="document"/>
            <wsdl:input name="greetMeRequest">
                <soap:body use="literal"/>
                <wsp:PolicyReference URI="#Input_Policy" />
            </wsdl:input>
            <wsdl:output name="greetMeResponse">
                <soap:body use="literal"/>
                <wsp:PolicyReference URI="#Output_Policy" />
            </wsdl:output>
        </wsdl:operation>
        
    </wsdl:binding>
    
    <wsdl:service name="SOAPService">
        <wsdl:port binding="tns:Greeter_SOAPBinding" name="SoapPort">
            <soap:address location="http://localhost:9001/SoapContext/SoapPort"/>
        </wsdl:port>
    </wsdl:service>
    
    <wsp:Policy wsu:Id="AsymmetricSAML2Policy">
		<wsp:ExactlyOne>
			<wsp:All>
				<wsam:Addressing wsp:Optional="false">
					<wsp:Policy />
				</wsam:Addressing>
				<sp:AsymmetricBinding>
					<wsp:Policy>
						<sp:InitiatorToken>
							<wsp:Policy>
								<sp:IssuedToken
									sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/AlwaysToRecipient">
									<sp:RequestSecurityTokenTemplate>
										<t:TokenType>http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0</t:TokenType>
										<t:KeyType>http://docs.oasis-open.org/ws-sx/ws-trust/200512/PublicKey</t:KeyType>
									</sp:RequestSecurityTokenTemplate>
									<wsp:Policy>
										<sp:RequireInternalReference />
									</wsp:Policy>
									<sp:Issuer>
										<wsaw:Address>http://localhost:8080/SecurityTokenService/
										</wsaw:Address>
									</sp:Issuer>
								</sp:IssuedToken>
							</wsp:Policy>
						</sp:InitiatorToken>
						<sp:RecipientToken>
							<wsp:Policy>
								<sp:X509Token
									sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702/IncludeToken/Never">
									<wsp:Policy>
										<sp:WssX509V3Token10 />
										<sp:RequireIssuerSerialReference />
									</wsp:Policy>
								</sp:X509Token>
							</wsp:Policy>
						</sp:RecipientToken>
						<sp:Layout>
							<wsp:Policy>
								<sp:Lax />
							</wsp:Policy>
						</sp:Layout>
						<sp:IncludeTimestamp />
						<sp:OnlySignEntireHeadersAndBody />
						<sp:AlgorithmSuite>
							<wsp:Policy>
								<sp:Basic128 />
							</wsp:Policy>
						</sp:AlgorithmSuite>
					</wsp:Policy>
				</sp:AsymmetricBinding>
				<sp:Wss11>
					<wsp:Policy>
						<sp:MustSupportRefIssuerSerial />
						<sp:MustSupportRefThumbprint />
						<sp:MustSupportRefEncryptedKey />
					</wsp:Policy>
				</sp:Wss11>
				<sp:Trust13>
					<wsp:Policy>
						<sp:MustSupportIssuedTokens />
						<sp:RequireClientEntropy />
						<sp:RequireServerEntropy />
					</wsp:Policy>
				</sp:Trust13>
			</wsp:All>
		</wsp:ExactlyOne>
	</wsp:Policy>
	
	<wsp:Policy wsu:Id="Input_Policy">
		<wsp:ExactlyOne>
			<wsp:All>
				<sp:EncryptedParts>
					<sp:Body />
				</sp:EncryptedParts>
				<sp:SignedParts>
					<sp:Body />
					<sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="AckRequested"
						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
					<sp:Header Name="SequenceAcknowledgement"
						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
					<sp:Header Name="Sequence"
						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
					<sp:Header Name="CreateSequence"
						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
				</sp:SignedParts>
			</wsp:All>
		</wsp:ExactlyOne>
	</wsp:Policy>
	
	<wsp:Policy wsu:Id="Output_Policy">
		<wsp:ExactlyOne>
			<wsp:All>
				<sp:EncryptedParts>
					<sp:Body />
				</sp:EncryptedParts>
				<sp:SignedParts>
					<sp:Body />
					<sp:Header Name="To" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="From" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="FaultTo" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="ReplyTo" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="MessageID" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="RelatesTo" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="Action" Namespace="http://www.w3.org/2005/08/addressing" />
					<sp:Header Name="AckRequested"
						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
					<sp:Header Name="SequenceAcknowledgement"
						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
					<sp:Header Name="Sequence"
						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
					<sp:Header Name="CreateSequence"
						Namespace="http://docs.oasis-open.org/ws-rx/wsrm/200702" />
				</sp:SignedParts>
			</wsp:All>
		</wsp:ExactlyOne>
	</wsp:Policy>
        
</wsdl:definitions>

