<?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

-->

<!--
 $Id: wholesaler.wsdl,v 1.11 2010-10-21 14:23:11 snajper Exp $
-->

<wsdl:definitions
        name="WholesaleService"
        targetNamespace="http://example.org/wholesaler"
        xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:wsap10="http://www.w3.org/2006/05/addressing/wsdl"
        xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
        xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
        xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/09/policy/addressing"
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
        xmlns:tns="http://example.org/wholesaler"
        xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
        xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"
        xmlns:wsa10="http://www.w3.org/2005/08/addressing">
    <wsp:Policy
            wsu:Id="WholesalerPort_policy">
        <wsp:ExactlyOne>
            <wsp:All>
                <wsrm:RMAssertion
                        xmlns:wsrm="http://schemas.xmlsoap.org/ws/2005/02/rm/policy">
                    <wsrm:InactivityTimeout
                            Milliseconds="600000"/>

                    <wsrm:AcknowledgementInterval
                            Milliseconds="200"/>
                </wsrm:RMAssertion>

                <sp:SymmetricBinding
                        xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                    <wsp:Policy>
                        <sp:ProtectionToken>
                            <wsp:Policy>
                                <sp:SecureConversationToken
                                        sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
                                    <wsp:Policy>
                                        <sp:RequireDerivedKeys/>

                                        <sp:BootstrapPolicy>
                                            <wsp:Policy>
                                                <sp:SymmetricBinding>
                                                    <wsp:Policy>
                                                        <sp:ProtectionToken>
                                                            <wsp:Policy>
                                                                <sp:X509Token

                                                                        sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">
                                                                    <wsp:Policy>
                                                                        <sp:RequireDerivedKeys/>

                                                                        <sp:RequireThumbprintReference/>

                                                                        <sp:WssX509V3Token10/>
                                                                    </wsp:Policy>
                                                                </sp:X509Token>
                                                            </wsp:Policy>
                                                        </sp:ProtectionToken>

                                                        <sp:AlgorithmSuite>
                                                            <wsp:Policy>
                                                                <sp:Basic256/>
                                                            </wsp:Policy>
                                                        </sp:AlgorithmSuite>

                                                        <sp:Layout>
                                                            <wsp:Policy>
                                                                <sp:Strict/>
                                                            </wsp:Policy>
                                                        </sp:Layout>

                                                        <sp:IncludeTimestamp/>

                                                        <sp:EncryptSignature/>

                                                        <sp:OnlySignEntireHeadersAndBody/>
                                                    </wsp:Policy>
                                                </sp:SymmetricBinding>

                                                <sp:EndorsingSupportingTokens>
                                                    <wsp:Policy>
                                                        <sp:IssuedToken
                                                                sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">                                    
                                                             <sp:Issuer>
                                                                <wsa10:Address>http://localhost:8080/pricequote-wcf/sts</wsa10:Address>
                                                                <wsa10:Metadata>
                                                                    <wsx:Metadata>
                                                                        <wsx:MetadataSection>
                                                                            <wsx:MetadataReference>
                                                                                <wsa10:Address>http://localhost:8080/pricequote-wcf/sts</wsa10:Address> 
                                                                            </wsx:MetadataReference>
                                                                        </wsx:MetadataSection>
                                                                    </wsx:Metadata>
                                                                </wsa10:Metadata>
                                                            </sp:Issuer>        
                                                            <sp:RequestSecurityTokenTemplate>
                                                                <t:KeyType
                                                                        xmlns:t="http://schemas.xmlsoap.org/ws/2005/02/trust">http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey</t:KeyType>
                                                            </sp:RequestSecurityTokenTemplate>
                                                            <wsp:Policy>
                                                                <sp:RequireDerivedKeys/>
                                                                <sp:RequireInternalReference/>
                                                            </wsp:Policy>
                                                        </sp:IssuedToken>
                                                    </wsp:Policy>
                                                </sp:EndorsingSupportingTokens>

                                                <!--<sp:EndorsingSupportingTokens>-->
                                                    <!--<wsp:Policy>-->
                                                        <!--<sp:X509Token-->
                                                                <!--sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">-->
                                                            <!--<wsp:Policy>-->
                                                                <!--sp:RequireDerivedKeys/-->
                                                                <!--<sp:RequireThumbprintReference/>-->
<!---->
                                                                <!--<sp:WssX509V3Token10/>-->
                                                            <!--</wsp:Policy>-->
                                                        <!--</sp:X509Token>-->
                                                    <!--</wsp:Policy>-->
                                                <!--</sp:EndorsingSupportingTokens>-->

                                                <sp:Wss11>
                                                    <wsp:Policy>
                                                        <sp:MustSupportRefKeyIdentifier/>

                                                        <sp:MustSupportRefIssuerSerial/>

                                                        <sp:MustSupportRefThumbprint/>

                                                        <sp:MustSupportRefEncryptedKey/>

                                                        <sp:RequireSignatureConfirmation/>
                                                    </wsp:Policy>
                                                </sp:Wss11>

                                                <sp:Trust10>
                                                    <wsp:Policy>
                                                        <sp:MustSupportIssuedTokens/>

                                                        <sp:RequireClientEntropy/>

                                                        <sp:RequireServerEntropy/>
                                                    </wsp:Policy>
                                                </sp:Trust10>
                                            </wsp:Policy>
                                        </sp:BootstrapPolicy>
                                    </wsp:Policy>
                                </sp:SecureConversationToken>
                            </wsp:Policy>
                        </sp:ProtectionToken>

                        <sp:AlgorithmSuite>
                            <wsp:Policy>
                                <sp:Basic256/>
                            </wsp:Policy>
                        </sp:AlgorithmSuite>

                        <sp:Layout>
                            <wsp:Policy>
                                <sp:Strict/>
                            </wsp:Policy>
                        </sp:Layout>

                        <sp:IncludeTimestamp/>

                        <sp:EncryptSignature/>

                        <sp:OnlySignEntireHeadersAndBody/>
                    </wsp:Policy>
                </sp:SymmetricBinding>

                <sp:Wss11
                        xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                    <wsp:Policy>
                        <sp:MustSupportRefKeyIdentifier/>

                        <sp:MustSupportRefIssuerSerial/>

                        <sp:MustSupportRefThumbprint/>

                        <sp:MustSupportRefEncryptedKey/>
                    </wsp:Policy>
                </sp:Wss11>

                <sp:Trust10
                        xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                    <wsp:Policy>
                        <sp:MustSupportIssuedTokens/>

                        <sp:RequireClientEntropy/>

                        <sp:RequireServerEntropy/>
                    </wsp:Policy>
                </sp:Trust10>
                <sc:KeyStore xmlns:sc="http://schemas.sun.com/2006/03/wss/server"
                             location="$WSIT_HOME/xws-security/etc/server-keystore.jks" storepass="changeit"
                             alias="bob"/>
                <sc:TrustStore xmlns:sc="http://schemas.sun.com/2006/03/wss/server"
                               location="$WSIT_HOME/xws-security/etc/server-truststore.jks" storepass="changeit"/>

                <wsap10:UsingAddressing/>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>

    <wsp:Policy
            wsu:Id="WholesalerPort_getQuote_Input_policy">
        <wsp:ExactlyOne>
            <wsp:All>
                <sp:SignedParts
                        xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                    <sp:Body/>

                    <sp:Header
                            Name="Sequence"
                            Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm"/>

                    <sp:Header
                            Name="SequenceAcknowledgement"
                            Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm"/>

                    <sp:Header
                            Name="AckRequested"
                            Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm"/>

                    <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:SignedParts>

                <sp:EncryptedParts
                        xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                    <sp:Body/>
                </sp:EncryptedParts>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>

    <wsp:Policy
            wsu:Id="WholesalerPort_getQuote_output_policy">
        <wsp:ExactlyOne>
            <wsp:All>
                <sp:SignedParts
                        xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                    <sp:Body/>

                    <sp:Header
                            Name="Sequence"
                            Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm"/>

                    <sp:Header
                            Name="SequenceAcknowledgement"
                            Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm"/>

                    <sp:Header
                            Name="AckRequested"
                            Namespace="http://schemas.xmlsoap.org/ws/2005/02/rm"/>

                    <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:SignedParts>

                <sp:EncryptedParts
                        xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
                    <sp:Body/>
                </sp:EncryptedParts>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>

    <wsdl:types>
        <xsd:schema
                xmlns="http://www.w3.org/2001/XMLSchema"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                targetNamespace="http://example.org/wholesaler"
                xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
                elementFormDefault="qualified"
                attributeFormDefault="unqualified">
            <xsd:element name='id' type='xsd:int'/>
            <element name="quote">
                <complexType>
                    <sequence>
                        <element name="price" type="float"/>
                        <!--<element name="specs" type="string" xmime:expectedContentTypes="text/xml"/>-->
                        <element name="photo" type="base64Binary" xmime:expectedContentTypes="image/jpeg"/>
                    </sequence>
                </complexType>
            </element>
        </xsd:schema>
    </wsdl:types>

    <wsdl:message
            name="getQuoteRequest">
        <wsdl:part
                name="id"
                element="tns:id"/>
    </wsdl:message>

    <wsdl:message
            name="getQuoteResponse">
        <wsdl:part
                name="quote"
                element="tns:quote"/>
    </wsdl:message>

    <wsdl:portType
            name="WholesalerPortType">
        <wsdl:operation
                name="getQuote">
            <wsdl:input
                    wsap10:Action="http://example.org/wholesaler/request"
                    name="getQuoteRequest"
                    message="tns:getQuoteRequest"/>

            <wsdl:output
                    wsap10:Action="http://example.org/wholesaler/response"
                    name="getQuoteResponse"
                    message="tns:getQuoteResponse"/>
        </wsdl:operation>
    </wsdl:portType>

    <wsdl:binding
            name="WholesalerPort"
            type="tns:WholesalerPortType">
        <wsp:PolicyReference
                URI="#WholesalerPort_policy"/>

        <soap:binding
                transport="http://schemas.xmlsoap.org/soap/http"/>

        <wsdl:operation
                name="getQuote">
            <soap:operation
                    soapAction="http://example.org/wholesaler/request"
                    style="document"/>

            <wsdl:input
                    name="getQuoteRequest">
                <wsp:PolicyReference
                        URI="#WholesalerPort_getQuote_Input_policy"/>

                <soap:body
                        use="literal"/>
            </wsdl:input>

            <wsdl:output
                    name="getQuoteResponse">
                <wsp:PolicyReference
                        URI="#WholesalerPort_getQuote_output_policy"/>

                <soap:body
                        use="literal"/>
            </wsdl:output>
        </wsdl:operation>
    </wsdl:binding>

    <wsdl:service
            name="WholesaleService">
        <wsdl:port
                name="WholesalerPort"
                binding="tns:WholesalerPort">
            <soap:address
                    location="http://129.145.133.244/wholesaler/wholesalerservice.svc/SecureConversation"
                    />
        </wsdl:port>
    </wsdl:service>
</wsdl:definitions>
