<?xml version="1.0" encoding="utf-8"?>
<!--

    Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.

    This program and the accompanying materials are made available under the
    terms of the Eclipse Distribution License v. 1.0, which is available at
    http://www.eclipse.org/org/documents/edl-v10.php.

    SPDX-License-Identifier: BSD-3-Clause

-->

<wsdl:definitions name="SecurityTokenService" targetNamespace="http://tempuri.org/"  xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <!-- begin :Keystore Info : latest method : referred from wsdl:service element -->
    <wsp:Policy wsu:Id="ClientKeystorePolicy" xmlns:sc="http://schemas.sun.com/2006/03/wss/client" xmlns:scc="http://schemas.sun.com/ws/2006/05/sc/client" xmlns:wspp="http://java.sun.com/xml/ns/wsit/policy">
        <wsp:ExactlyOne>
            <wsp:All>
                <sc:KeyStore alias="alice" location="$WSIT_HOME/xws-security/etc/client-keystore.jks" storepass="changeit" type="JKS" wspp:visibility="private"/>
                <sc:TrustStore location="$WSIT_HOME/xws-security/etc/client-truststore.jks" peeralias="bob" storepass="changeit" type="JKS" wspp:visibility="private"/>
                <!-- sc:ValidatorConfiguration wspp:visibility="private" sc:maxClockSkew="1200000" sc:timestampFreshnessLimit="1200000"/ -->
                <scc:SCClientConfiguration wspp:visibility="private">
                    <scc:LifeTime>36000</scc:LifeTime>
                </scc:SCClientConfiguration>
                <sc:CallbackHandlerConfiguration xmlns:sc="http://schemas.sun.com/2006/03/wss/client">
                    <sc:CallbackHandler default="Alice" name="usernameHandler"/>
                    <sc:CallbackHandler default="abcd!1234" name="passwordHandler"/>
                </sc:CallbackHandlerConfiguration>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>
    <wsp:Policy wsu:Id="STSClientKeystorePolicy" xmlns:sc="http://schemas.sun.com/2006/03/wss/client" xmlns:scc="http://schemas.sun.com/ws/2006/05/sc/client" xmlns:wspp="http://java.sun.com/xml/ns/wsit/policy">
        <wsp:ExactlyOne>
            <wsp:All>
                <sc:KeyStore alias="alice" location="$WSIT_HOME/xws-security/etc/client-keystore.jks" storepass="changeit" type="JKS" wspp:visibility="private"/>
                <sc:TrustStore location="$WSIT_HOME/xws-security/etc/client-truststore.jks" peeralias="wssip" storepass="changeit" type="JKS" wspp:visibility="private"/>
                <!-- sc:ValidatorConfiguration wspp:visibility="private" sc:maxClockSkew="1200000" sc:timestampFreshnessLimit="1200000"/ -->
                <scc:SCClientConfiguration wspp:visibility="private">
                    <scc:LifeTime>36000</scc:LifeTime>
                </scc:SCClientConfiguration>
                <sc:CallbackHandlerConfiguration xmlns:sc="http://schemas.sun.com/2006/03/wss/client">
                    <sc:CallbackHandler default="Alice" name="usernameHandler"/>
                    <sc:CallbackHandler default="abcd!1234" name="passwordHandler"/>
                </sc:CallbackHandlerConfiguration>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>
    <!-- end :Keystore Info : latest method : referred from wsdl:service element -->
    <wsdl:message name="PingRequest">
        <wsdl:part element="q:Ping" name="Ping" xmlns:q="http://xmlsoap.org/Ping"/>
    </wsdl:message>
    <wsdl:message name="PingResponse">
        <wsdl:part element="q:PingResponse" name="PingResponse" xmlns:q="http://xmlsoap.org/Ping"/>
    </wsdl:message>
    <wsdl:message name="ISecurityTokenService_IssueToken_InputMessage">
        <wsdl:part name="rstMessage" type="q1:MessageBody" xmlns:q1="http://schemas.message.com/Message"/>
    </wsdl:message>
    <wsdl:message name="ISecurityTokenService_IssueToken_OutputMessage">
        <wsdl:part name="IssueTokenResult" type="q2:MessageBody" xmlns:q2="http://schemas.message.com/Message"/>
    </wsdl:message>
    <wsdl:portType name="ISecurityTokenService">
        <wsdl:operation name="IssueToken">
            <wsdl:input message="tns:ISecurityTokenService_IssueToken_InputMessage" wsaw:Action="http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue"/>
            <wsdl:output message="tns:ISecurityTokenService_IssueToken_OutputMessage" wsaw:Action="http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:portType name="IPingService">
        <wsdl:operation name="Ping">
            <wsdl:input message="tns:PingRequest" name="PingRequest" wsaw:Action="http://xmlsoap.org/Ping"/>
            <wsdl:output message="tns:PingResponse" name="PingResponse" wsaw:Action="http://xmlsoap.org/Ping"/>
        </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="PingBinding" type="tns:IPingService">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsp:PolicyReference URI="#ClientKeystorePolicy"/>
        <wsdl:operation name="Ping">
            <soap:operation soapAction="http://xmlsoap.org/Ping" style="document"/>
            <wsdl:input>
                <soap:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
         <wsdl:binding name="CustomBinding_ISecurityTokenService1" type="tns:ISecurityTokenService">
         <wsp:PolicyReference URI="#STSClientKeystorePolicy"></wsp:PolicyReference>
         <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
         <wsdl:operation name="IssueToken">
         <soap12:operation soapAction="http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue" style="document"/>
         <wsdl:input>
         <soap12:body use="literal"/>
         </wsdl:input>
         <wsdl:output>
         <soap12:body use="literal"/>
         </wsdl:output>
         </wsdl:operation>
         </wsdl:binding>
    <wsdl:binding name="CustomBinding_ISecurityTokenService" type="tns:ISecurityTokenService">
        <wsp:PolicyReference URI="#STSClientKeystorePolicy"/>
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="IssueToken">
            <soap12:operation soapAction="http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue" style="document"/>
            <wsdl:input>
                <soap12:body use="literal"/>
            </wsdl:input>
            <wsdl:output>
                <soap12:body use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="SecurityTokenService">
             <wsdl:port binding="tns:CustomBinding_ISecurityTokenService1" name="CustomBinding_ISecurityTokenService1">
             <soap12:address location="REPLACE_WITH_ACTUAL_URL"/>
             </wsdl:port>
        <wsdl:port binding="tns:CustomBinding_ISecurityTokenService" name="CustomBinding_ISecurityTokenService">
            <soap12:address location="REPLACE_WITH_ACTUAL_URL"/>
        </wsdl:port>
    </wsdl:service>
    <wsdl:service name="SymmetricFederatedService">
        <wsdl:port binding="tns:PingBinding" name="CustomBinding_IPingService">
            <soap:address location="REPLACE_WITH_ACTUAL_URL"/>
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>
