<?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.8 2010-10-21 14:23:14 snajper Exp $
-->

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
             xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
             xmlns:wsap10="http://www.w3.org/2006/05/addressing/wsdl"
             xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
             xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
             xmlns:tns="http://example.org/wholesaler"
             targetNamespace="http://example.org/wholesaler">

    <wsp:Policy wsu:Id="OnlyAddressing_policy">
        <wsp:ExactlyOne>
            <wsp:All>
                <wsaw:UsingAddressing/>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>

    <wsp:Policy wsu:Id="OnlyMTOM_policy">
        <wsp:ExactlyOne>
            <wsp:All>
                <wsoma:OptimizedMimeSerialization
                        xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>

    <wsp:Policy wsu:Id="OnlyRM_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>
                <wsaw:UsingAddressing/>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>

    <wsp:Policy wsu:Id="Wholesaler_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: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:SignedParts>
                                                <sp:EncryptedParts>
                                                    <sp:Body/>
                                                </sp:EncryptedParts>
                                                <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: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/>
                <wsoma:OptimizedMimeSerialization
                        xmlns:wsoma="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization"/>
            </wsp:All>
        </wsp:ExactlyOne>
    </wsp:Policy>

    <wsp:Policy wsu:Id="Wholesaler_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="Wholesaler_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>

    <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>
    </types>

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

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

    <portType name="WholesalerPortType">
        <operation name="getQuote">
            <input message="tns:getQuoteRequest" wsaw:Action="http://example.org/wholesaler/request"/>
            <output message="tns:getQuoteResponse" wsaw:Action="http://example.org/wholesaler/response"/>
        </operation>
    </portType>

    <binding name="WholesalerBinding" type="tns:WholesalerPortType">
        <!--<wsp:PolicyReference URI="#OnlyMTOM_policy"/>-->
        <!--<wsp:PolicyReference URI="#OnlyRM_policy"/>-->
        <wsp:PolicyReference URI="#Wholesaler_policy"/>
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="getQuote">
            <soap:operation style="document" soapAction="http://example.org/wholesaler/request"/>
            <input>
                <wsp:PolicyReference URI="#Wholesaler_getQuote_Input_policy"/>
                <soap:body use="literal"/>
            </input>
            <output>
                <wsp:PolicyReference URI="#Wholesaler_getQuote_Output_policy"/>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>

    <service name="WholesalerQuoteService">
        <port name="WholesalerPort" binding="tns:WholesalerBinding">
            <soap:address location="http://localhost:8080/pricequote/wholesaler"/>
        </port>
    </service>
    <plink:partnerLinkType xmlns:plink="http://schemas.xmlsoap.org/ws/2004/03/partner-link/" name="Wholesaler1PLT">
        <plink:role portType="tns:WholesalerPortType" name="wholesaler1Role"/>
    </plink:partnerLinkType>
</definitions>

