<?xml version="1.0" encoding="UTF-8"?>
<!--
     Collaboration Protocol Profile and Agreement Version 3.0
     Committee Specification 01
     24 September 2020

     Copyright (c) OASIS Open 2020. All Rights Reserved.
     Source: https://docs.oasis-open.org/ebcore/cppa/v3.0/cs01/
     Latest version of narrative specification: https://docs.oasis-open.org/ebcore/cppa/v3.0/cppa-v3.0.html
     TC IPR Statement: https://www.oasis-open.org/committees/ebcore/ipr.php 
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:cppa="http://docs.oasis-open.org/ebcore/ns/cppa/v3.0"
    xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
    xmlns:h="http://www.w3.org/1999/xhtml" xmlns:dsig11="http://www.w3.org/2009/xmldsig11#"
    xmlns:ebbp="http://docs.oasis-open.org/ebxml-bp/ebbp-2.0"
    xmlns:xkms="http://www.w3.org/2002/03/xkms#"
    targetNamespace="http://docs.oasis-open.org/ebcore/ns/cppa/v3.0" elementFormDefault="qualified"
    attributeFormDefault="unqualified" version="3.0">

    <xs:annotation>
        <xs:documentation>
            <p>This XML schema is part of the  
                <a href="http://docs.oasis-open.org/ebcore/cppa/v3.0/">OASIS CPPA3 specification</a>
                developed by the <a href="https://www.oasis-open.org/committees/ebcore/">OASIS ebCore TC</a>.</p>
            <p>Two elements defined in this schema can serve as root elements of CPPA3 XML documents:</p>
            <ol>
                <li>The <a href="#CPP">CPP</a> element defines a Collaboration Protocol Profile.</li>
                <li>The <a href="#CPA">CPA</a> element defines a Collaboration-Protocol Agreement.</li>
            </ol>
        </xs:documentation>
    </xs:annotation>

    <xs:import namespace="http://www.w3.org/XML/1998/namespace"
        schemaLocation="https://www.w3.org/2009/01/xml.xsd"/>

    <xs:import namespace="http://www.w3.org/2000/09/xmldsig#"
        schemaLocation="http://docs.oasis-open.org/ebcore/ebcore-au/v1.0/cs01/schema/xmldsig1-schema.xsd"/>

    <xs:import namespace="http://www.w3.org/2009/xmldsig11#"
        schemaLocation="http://docs.oasis-open.org/ebcore/ebcore-au/v1.0/cs01/schema/xmldsig1-schema.xsd"/>

    <xs:import namespace="http://docs.oasis-open.org/ebxml-bp/ebbp-2.0"
        schemaLocation="http://docs.oasis-open.org/ebxml-bp/2.0.4/OS/schema/ebbp-2.0.4.xsd"/>

    <xs:import namespace="http://www.w3.org/2002/03/xkms#"
        schemaLocation="https://www.w3.org/TR/xkms2/Schemas/xkms.xsd"/>

    <!-- Collaboration Protocol Profile -->

    <xs:element name="CPP">
        <xs:annotation>
            <xs:documentation>
                <p>A Collaboration Protocol Profile (<a href="#CPP">CPP</a>) defines the capabilities of a 
                    Party to engage in electronic business message exchange with other Parties. 
                    These capabilities include both 
                    technology and business capabilities, such as supported transport and messaging 
                    protocols, and what business collaborations the party can participate in.</p>
                <p>Unlike the CPPA version 2.0 schema, only a single <a href="#PartyInfo">PartyInfo</a> 
                    element is allowed in a CPP. The use case of a party that has different party 
                    identities, which may be associated with different service specifications or with 
                    different channels, transports etc. can be addressed by using different CPP 
                    documents for the party.  
                </p>
                <p>A <a href="#CPP">CPP</a> MAY be signed by by the party involved and/or 
                    by another party involved in the creation or distribution of the <a href="#CPP">CPP</a>.</p>
                <p>The optional attributes <em>allowed</em> and <em>denied</em> in the
                    <em>acl_attributes</em> attribute group MAY be attached at the <a href="#CPP">CPP</a>, 
                    <a href="#ServiceBinding">ServiceBinding</a>, or 
                    <a href="#ActionBinding">ActionBinding</a> levels. These attributes control 
                    possibilities for CPA formation of the CPP with counterparty CPPs. 
                </p>
                <p>If no <a href="#ServiceSpecification">ServiceSpecification</a> is present in the CPP, 
                    the party indicates that it is unable to participate in electronic business message
                    exchange.
                </p>
                <p>The <a href="#CPPAExtension">CPPAExtension</a> element can be used for extensibility 
                    of <a href="#CPP">CPP</a> elements.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:ProfileInfo"/>
                <xs:element ref="cppa:PartyInfo"/>
                <xs:element ref="cppa:ServiceSpecification" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:PropertySet" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:Channel" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:ChannelFeature" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:Transport" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:PayloadProfile" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:Packaging" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:PartyIdList" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="ds:Signature" minOccurs="0"/>
                <xs:element ref="cppa:CPPAExtension" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attributeGroup ref="cppa:acl_attributes"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="CPPAExtension" abstract="true" type="cppa:CPPAExtensionType">
        <xs:annotation>
            <xs:documentation>An abstract top level CPP or CPA Extension element</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="CPPAExtensionType" abstract="true">
        <xs:annotation>
            <xs:documentation>An abstract CPPA Extension type</xs:documentation>
        </xs:annotation>
    </xs:complexType>

    <!-- Elements and Types only used in a CPP -->

    <xs:element name="ProfileInfo">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#ProfileInfo">ProfileInfo</a> element provides metadata about 
                    the Collaboration Protocol Profile.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:ProfileIdentifier"/>
                <xs:element ref="cppa:Description" minOccurs="0"/>
                <xs:element ref="cppa:ActivationDate" minOccurs="0"/>
                <xs:element ref="cppa:ExpirationDate" minOccurs="0"/>
                <xs:element ref="cppa:PhaseIn" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="ProfileIdentifier">
        <xs:annotation>
            <xs:documentation>
                <p>In a <a href="#CPP">CPP</a>, 
                    the <a href="#ProfileIdentifier">ProfileIdentifier</a> element is used to provide an 
                    identifier for the profile. 
                    When used in a <a href="#CPA">CPA</a>,
                    it identifies a profile that the collaboration protocol agreement relates to.</p>
                <p>The combination of the type value and element content MUST be unique in the context of the 
                    party to which it relates. </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="cppa:non-empty-string">
                    <xs:attribute name="type" type="xs:anyURI">
                        <xs:annotation>
                            <xs:documentation>
                                <p>The <em>type</em> attribute defines a namespace in which 
                                    the content of the <a href="#ProfileIdentifier">ProfileIdentifier</a> 
                                    element is to be interpreted. 
                                </p>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                    <xs:attribute name="href" type="xs:anyURI" use="optional">
                        <xs:annotation>
                            <xs:documentation>
                                <p>An optional URL locating the referenced <a href="#CPP">CPP</a>. This 
                                    attribute MAY be used in a 
                                    <a href="#CPA">CPA</a> to express the location from which a 
                                    referenced <a href="#CPP">CPP</a> was or can be retrieved. 
                                </p>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

    <!-- Party ID lists are used for white listing and black listing counter parties in CPPs -->

    <xs:element name="PartyIdList">
        <xs:annotation>
            <xs:documentation>
                <p>This element defines a list of party identifiers or (recursively) references to lists of party 
                    identifiers. The list logically includes all <a href="#PartyId">PartyId</a>s included as 
                    direct child elements of the <a href="#PartyIdList">PartyIdList</a> element, as well as 
                    all <a href="#PartyId">PartyId</a>s
                    indirectly included as child elements of <a href="#PartyIdList">PartyIdList</a>s referenced
                    (possibly recursively) as <a href="#PartyIdListsRef">PartyIdListRef</a> child elements.
                </p>
                <p>Party Id lists are used for white listing and black listing counterparties in CPPs, 
                    using the <em>allowed</em> and <em>denied</em> attributes. </p>
                <p>Party Id list references MUST NOT be circular. </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:choice minOccurs="1" maxOccurs="unbounded">
                <xs:element ref="cppa:PartyId"/>
                <xs:element ref="cppa:PartyIdListRef"/>
            </xs:choice>
            <xs:attribute name="id" type="xs:ID">
                <xs:annotation>
                    <xs:documentation>A unique identifier of the party identifier list.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="PartyIdListRef">
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="xs:string">
                    <xs:attribute name="href" type="xs:anyURI">
                        <xs:annotation>
                            <xs:documentation>A reference to a <a href="#PartyIdList">PartyIdList</a>. </xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

    <!-- Collaboration Protocol Agreement -->

    <xs:element name="CPA">
        <xs:annotation>
            <xs:documentation>
                <p>A Collaboration-Protocol Agreement (<a href="#CPA">CPA</a>) defines a set of specified 
                    services and roles that a <a href="#Party">Party</a> and a 
                    <a href="#CounterParty">CounterParty</a> agree upon to deploy, acting in agreed roles, 
                    using particular <a href="#Channel">Channel</a>s and <a href="#Transport">Transport</a>s, 
                    to exchange particular profiled <em>Payloads</em> using particular 
                    <a href="#Packaging">Packaging</a>.  A <a href="#CPA">CPA</a> MAY be signed by the 
                    parties involved and/or by any other parties involved in the formation of 
                    the <a href="#CPA">CPA</a>.
                </p>
                <p>Unlike the CPPA version 2.0 schema, only a single <a href="#PartyInfo">PartyInfo</a> 
                    element is allowed in a CPA. A CPA also includes only a single 
                    <a href="#CounterPartyInfo">CounterPartyInfo</a> element.   
                </p>
                <p>The <a href="#CPPAExtension">CPPAExtension</a> element can be used for extensibility of 
                    <a href="#CPA">CPA</a> elements.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:AgreementInfo" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="cppa:PartyInfo" minOccurs="1" maxOccurs="1"/>
                <xs:element ref="cppa:CounterPartyInfo" minOccurs="1" maxOccurs="1"/>
                <xs:element ref="cppa:ServiceSpecification" maxOccurs="unbounded"/>
                <xs:element ref="cppa:PropertySet" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:Channel" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:ChannelFeature" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:Transport" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:PayloadProfile" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:Packaging" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="ds:Signature" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:CPPAExtension" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <!-- Elements and Types only used in a CPA -->

    <xs:element name="AgreementInfo">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#AgreementInfo">AgreementInfo</a> element provides metadata about 
                    the <a href="#CPA">CPA</a>.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:annotation/>
            <xs:sequence>
                <xs:element ref="cppa:AgreementIdentifier"/>
                <xs:element ref="cppa:Description" minOccurs="0"/>
                <xs:element ref="cppa:ProfileIdentifier" minOccurs="0" maxOccurs="2"/>
                <xs:element ref="cppa:ActivationDate" minOccurs="0"/>
                <xs:element ref="cppa:ExpirationDate" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="AgreementIdentifier">
        <xs:annotation>
            <xs:documentation>
                <p>The AgreementIdentifier element is used to provide an identifier for the agreement. 
                    The type value and element content of the element MUST be unique in the context of the pair of 
                    parties to which it relates.</p>
                <p>Communities MAY adopt format conventions for the value of the 
                    <a href="#AgreementIdentifier">AgreementIdentifier</a> element.
                    For example, the value MAY be derived from the values of two 
                    <a href="#CPP">CPP</a> <a href="#ProfileIdentifier">ProfileIdentifier</a>s (if 
                    the <a href="#CPA">CPA</a> 
                    is formed from <a href="#CPP">CPP</a>) or from the <em>(Counter)PartyInfo/PartyId</em> 
                    values in the <a href="#CPA">CPA</a>. <a href="#CPA">CPA</a> tooling MAY allow users 
                    to specify and apply specific conventions.
                </p>
                <p>The element corresponds, for ebMS2, to the <em>CPAId</em> message header</p>
                <p>For ebMS3, it naturally corresponds to the <em>PMode.Agreement</em> parameter 
                    and <em>AgreementRef</em> header. However, that parameter and header are sometimes 
                    used to specify adherence to multilateral, community agreements. In that case, they 
                    are then more like a CPPA3 <a href="#ChannelProfile">ChannelProfile</a> indicator.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="cppa:non-empty-string">
                    <xs:attribute name="type" type="xs:anyURI">
                        <xs:annotation>
                            <xs:documentation>
                                <p>The <em>type</em> attribute defines a namespace in which 
                                    the value of <a href="#AgreementIdentifier">AgreementIdentifier</a> 
                                    is to be interpreted. 
                                </p>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="ActivationDate" type="xs:dateTime">
        <xs:annotation>
            <xs:documentation>
                <p>When used in a <a href="#CPP">CPP</a> or 
                    <a href="#CPA">CPA</a>, this element defines the date and time from which the <a href="#CPP">CPP</a> or 
                    <a href="#CPA">CPA</a> is valid.</p>
                <p>When used in a <a href="#ServiceBinding">ServiceBinding</a>, 
                    this element defines the date and time from which the <a href="#ServiceBinding">ServiceBinding</a> 
                    is valid.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ExpirationDate" type="xs:dateTime">
        <xs:annotation>
            <xs:documentation>
                <p>When used in a <a href="#CPP">CPP</a> or 
                    <a href="#CPA">CPA</a>, 
                    this element defines the date and time at which a <a href="#CPP">CPP</a> or 
                    <a href="#CPA">CPA</a> expires.</p>
                <p>When used in a <a href="#ServiceBinding">ServiceBinding</a>, 
                    this element defines the date and time from which a <a href="#ServiceBinding">ServiceBinding</a> 
                    expires.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="PhaseIn" type="xs:duration">
        <xs:annotation>
            <xs:documentation>
                <p>This element defines the minimum interval needed to phase in an agreement created from a
                    a collaboration protocol profile. This element MAY be useful if deployment of a 
                    <a href="#CPA">CPA</a> in a company involves a service management process that is 
                    not a (fully) automated process.
                    When forming an agreement for two profiles, the longest 
                    of the intervals specified in the two profiles is to be used.  
                </p>
            </xs:documentation>
        </xs:annotation>

    </xs:element>

    <!-- Common elements and types -->

    <xs:element name="PartyInfo" type="cppa:PartyInfoType">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#PartyInfo">PartyInfo</a> element provides information about a Party. 
                    This element is used in <a href="#CPP">CPP</a> and <a href="#CPA">CPA</a>.
                </p>
                <p>When used for ebMS3, this element encodes some information relating to the
                    <em>PMode.{Initiator/Responder}.Party</em> parameters.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="CounterPartyInfo" type="cppa:PartyInfoType">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#CounterPartyInfo">CounterPartyInfo</a> element provides information 
                    about a CounterParty. This element is only used in <a href="#CPA">CPA</a>.</p>
                <p>When used for ebMS3, this element encodes some information relating to the
                    <em>PMode.{Initiator/Responder}.Party</em> parameters.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="PartyInfoType">
        <xs:annotation>
            <xs:documentation>
                <p>For a Party or CounterParty, its <em>Name</em>
                    <em>ID</em>s, <em>Contact</em> information, any certificates, trusted anchors,
                    certificate policies and IDPs used by the party MAY be specified. </p>
                <p>The semantics of presence of more than one <a href="#PartyName">PartyName</a> is
                    out of scope for this specification.  
                </p>
                <p>If more than one child <a href="#PartyId">PartyId</a> element is used in a CPPA3
                    document for a party, any or all party identifiers MAY be used to identify the party.
                    If more than one <a href="#PartyId">PartyId</a> element is used in a CPPA3 document
                    for a party,
                    presence of any or all related headers in related messages configured using 
                    the CPPA3 document is dependent on the channel (which may or may not allow or require 
                    presence of multiple party identifiers), channel profile, and/or implementation used. 
                </p>
                <p>The <a href="#PartyInfoExtension">PartyInfoExtension</a> element can be used for 
                    extensibility of <a href="#PartyInfo">PartyInfo</a> and 
                    <a href="#CounterPartyInfo">CounterPartyInfo</a> elements.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="cppa:PartyName" maxOccurs="unbounded"/>
            <xs:element ref="cppa:PartyId" maxOccurs="unbounded"/>
            <xs:element ref="cppa:PartyContact" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="cppa:Certificate" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="cppa:TrustAnchorSet" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="cppa:CertificatePolicySet" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="cppa:CertificateDefaults" minOccurs="0"/>
            <xs:element ref="cppa:IDPRegistration" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="cppa:IDPRegistrationSet" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="cppa:SSHKey" minOccurs="0" maxOccurs="unbounded"></xs:element>
            <xs:element ref="cppa:PartyInfoExtension" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="href" type="xs:anyURI" use="optional">
            <xs:annotation>
                <xs:documentation>
                    <p>The <em>href</em> attribute provides a link, in the form of a URI, to additional 
                        information about the Party or CounterParty. Typically, this would be a URL 
                        from which the information can be obtained. The content and/or format of that 
                        information at that URI is outside of the scope of this specification.</p>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:element name="PartyInfoExtension" abstract="true" type="cppa:PartyInfoExtensionType">
        <xs:annotation>
            <xs:documentation>An abstract PartyInfo Extension element</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="PartyInfoExtensionType" abstract="true">
        <xs:annotation>
            <xs:documentation>An abstract PartyInfo Extension type</xs:documentation>
        </xs:annotation>
    </xs:complexType>

    <xs:element name="PartyName">
        <xs:annotation>
            <xs:documentation>
                <p>This element indicates the common, human readable name of the organization. 
                    The value of each <a href="#PartyName">PartyName</a> MUST identify the 
                    organization, entity, division or group of an organization described in the 
                    parent 
                    <a href="#PartyInfo">PartyInfo</a> element in 
                    the <a href="#CPP">CPP</a> or <a href="#CPA">CPA</a> document.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="cppa:non-empty-string">
                    <xs:attribute ref="xml:lang" use="optional">
                        <xs:annotation>
                            <xs:documentation>
                                <p>The language of the name.</p>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                    <xs:attribute name="href" type="xs:anyURI" use="optional">
                        <xs:annotation>
                            <xs:documentation>
                                <p>An optional reference to a resource about the named Party.</p>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="PartyId" type="cppa:PartyIdType">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#PartyId">PartyId</a> element provides a party identifier for a 
                    <em>(Counter)Party</em>.
                    This identifier is to be used to logically identify the Party.  
                    The value of the <a href="#PartyId">PartyId</a> element is a non-empty string. 
                </p>
                <p>When using the ebMS2 or ebMS3 protocols, the values of <a href="#PartyId">PartyId</a> 
                    MUST be used as 
                    <em>eb:From/eb:PartyId</em> and <em>eb:To/eb:PartyId</em> elements.
                    Note that these protocols require the <a href="#PartyId">PartyId</a>  to be a URI 
                    if the <em>type</em> attribute is not present.
                </p>
                <p>When using the AS2 or AS3 protocols, the values of <a href="#PartyId">PartyId</a> 
                    MUST be used as 
                    <em>AS2-From</em> and <em>AS2-To</em> and <em>AS3-From</em> 
                    and <em>AS3-To</em> system identifier headers, respectively.</p>
                <p>When using the AMQP protocol, the of <a href="#PartyId">PartyId</a> 
                    SHOULD be used as the <em>user-id</em> and <em>to</em> message properties.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="PartyIdType">
        <xs:simpleContent>
            <xs:extension base="cppa:non-empty-string">
                <xs:attribute name="type" type="xs:anyURI">
                    <xs:annotation>
                        <xs:documentation>
                            <p>The <em>type</em> attribute defines a namespace in which 
                                the value of <a href="#PartyId">PartyId</a> is to be interpreted.  
                                Use of the <a 
                                    href="http://docs.oasis-open.org/ebcore/PartyIdType/v1.0/">OASIS 
                                    ebCore Party Id Type specification</a> 
                                is RECOMMENDED.
                            </p>
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>

    <xs:element name="PartyContact">
        <xs:annotation>
            <xs:documentation>
                <p>A person or department that acts as a point of contact for a party.</p>
                <p>The content of this element is derived from the UN/CEFACT Core Component Library.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="ContactType" minOccurs="0" maxOccurs="1"
                    type="cppa:PartyContactType">
                    <xs:annotation>
                        <xs:documentation>The type of contact, e.g. business contact, technical contact,
                            security contact, administrative contact</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="DepartmentName" minOccurs="0" type="cppa:non-empty-string">
                    <xs:annotation>
                        <xs:documentation>The name, expressed as text, of the department 
                            to which this party contact belongs.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="PersonName" minOccurs="0" type="cppa:non-empty-string">
                    <xs:annotation>
                        <xs:documentation>The name, expressed as text, of the person 
                            for this party contact.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="JobTitle" minOccurs="0" type="cppa:non-empty-string">
                    <xs:annotation>
                        <xs:documentation>The job title, expressed as text, for this 
                            party contact.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="DirectTelephone" minOccurs="0" type="cppa:non-empty-string">
                    <xs:annotation>
                        <xs:documentation>The direct unstructured telephone communication 
                            information for this party contact.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="MobileTelephone" minOccurs="0" type="cppa:non-empty-string">
                    <xs:annotation>
                        <xs:documentation>The mobile unstructured telephone communication 
                            information for this party contact.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="Fax" minOccurs="0" type="cppa:non-empty-string">
                    <xs:annotation>
                        <xs:documentation>The fax unstructured telecommunication information 
                            for this party contact.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="Email" minOccurs="0" type="cppa:non-empty-string">
                    <xs:annotation>
                        <xs:documentation>The email communication information for this party 
                            contact.</xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element name="URICommunication" minOccurs="0" maxOccurs="unbounded"
                    type="cppa:non-empty-string">
                    <xs:annotation>
                        <xs:documentation>Uniform Resource Identifier (URI) communication 
                            information for this party contact.</xs:documentation>
                    </xs:annotation>
                </xs:element>
            </xs:sequence>
            <xs:attribute name="id">
                <xs:annotation>
                    <xs:documentation>The unique identifier of this party contact.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="PartyContactType">
        <xs:annotation>
            <xs:documentation>The type of party contact.  The XML type predefines four common 
                values and adds an option to define arbitrary other values.</xs:documentation>
        </xs:annotation>
        <xs:union>
            <xs:simpleType>
                <xs:annotation>
                    <xs:documentation/>
                </xs:annotation>
                <xs:restriction base="xs:string">
                    <xs:enumeration value="Business Contact">
                        <xs:annotation>
                            <xs:documentation>A contact for the party for business related issues</xs:documentation>
                        </xs:annotation>
                    </xs:enumeration>
                    <xs:enumeration value="Technical Contact">
                        <xs:annotation>
                            <xs:documentation>A contact for the party for technical issues</xs:documentation>
                        </xs:annotation>
                    </xs:enumeration>
                    <xs:enumeration value="Security Contact">
                        <xs:annotation>
                            <xs:documentation>A contact for the party for security issues</xs:documentation>
                        </xs:annotation>
                    </xs:enumeration>
                    <xs:enumeration value="Admin Contact">
                        <xs:annotation>
                            <xs:documentation>A contact for the party for administrative issues</xs:documentation>
                        </xs:annotation>
                    </xs:enumeration>
                </xs:restriction>
            </xs:simpleType>
            <xs:simpleType>
                <xs:annotation>
                    <xs:documentation>Alternative option to allow any other type of contact.</xs:documentation>
                </xs:annotation>
                <xs:restriction base="xs:string">
                    <xs:minLength value="1"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:union>
    </xs:simpleType>


    <!-- Security Tokens and Certificates -->

    <xs:element name="SecurityToken" abstract="true" type="cppa:SecurityTokenType">
        <xs:annotation>
            <xs:documentation>
                <p>An abstract Security Token</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="SecurityTokenType" abstract="true">
        <xs:attribute name="id" type="xs:ID">
            <xs:annotation>
                <xs:documentation>A unique identifier for the security token.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:element name="SecurityTokenRef" type="cppa:SecurityTokenRefType" abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>A abstract reference to a security token.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="SecurityTokenRefType" abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>Type definition of an abstract reference to a security token.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:complexType>

    <xs:element name="Certificate" substitutionGroup="cppa:SecurityToken">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies an X.509 Certificate.</p>
                <p>A certificate can be specified in one of two ways:</p>
                <ol>
                    <li>The certificate can be included in the <a href="#CPP">CPP</a> or 
                        <a href="#CPA">CPA</a> using an XML Signature 
                        <em>KeyInfo</em> element.</li>
                    <li>The certificate can be referenced, using an XML Key Management Service (XKMS) 
                        2.0 <em>LocateRequest</em>. In some use cases, this request obviates the need 
                        to include the certificate in 
                        the <a href="#CPP">CPP</a> or <a href="#CPA">CPA</a> document. 
                    </li>
                </ol>
                <p>While this schema uses an XKMS schema element, use of the XKMS protocol and the XKMS 
                    client and server software is NOT REQUIRED. Instead, the element is only used to specify 
                    requirements on the certificate such that a certificate that is not included in the 
                    <a href="#CPP">CPP</a> or 
                    <a href="#CPA">CPA</a> document can be located. 
                    In <a href="#CPA">CPA</a> formation, a matching certificate MAY be
                    selected using either by executing a XKMS <em>LocateRequest</em> against an XKMS server, or 
                    using some other mechanism. Any certificate obtained from this SHOULD be matched against 
                    any specified applicable trust anchors. 
                    Any use the resulting certificate, if one is successfully retrieved in <a href="#CPA">CPA</a> 
                    formation, is left to 
                    implementations or usage profiles. For example, an implementation MAY include the 
                    retrieved certificate instead of the <em>LocateRequest</em> in the formed <a href="#CPA">CPA</a>.
                </p>
                <p>In XKMS, the <em>Service</em> attribute is mandatory. If its value is non-empty, it MAY be set to
                    the value of the URI to which an XKMS request locating the certificate is to be directed.
                    Alternatively, the value MAY be used as a configuration parameter for locating the 
                    certificate.                     
                    If the  
                    value is empty (as allowed by the <em>anyURI</em> data type), the source from which the certificate is
                    to be retrieved is not expressed and its interpretation and use are implementation-dependent.                    
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:SecurityTokenType">
                    <xs:choice>
                        <xs:element ref="ds:KeyInfo"/>
                        <xs:element ref="xkms:LocateRequest"/>
                    </xs:choice>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="CertificateRef" type="cppa:CertificateRefType" abstract="true"
        substitutionGroup="cppa:SecurityTokenRef">
        <xs:annotation>
            <xs:documentation>
                <p>An abstract reference to a certificate.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="CertificateRefType">
        <xs:annotation>
            <xs:documentation>
                <p>Type definition of an abstract reference to a certificate.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:SecurityTokenRefType">
                <xs:attribute name="certId" type="xs:IDREF" use="required"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>


    <xs:element name="AnchorCertificateRef" type="cppa:CertificateRefType"
        substitutionGroup="cppa:CertificateRef">
        <xs:annotation>
            <xs:documentation>A reference to a trusted Certification Authority.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="CertificateDefaults">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#CertificateDefaults">CertificateDefaults</a> element expresses 
                    default certificates and default trust anchors for a 
                    <a href="#Party">Party</a> in a CPP or CPA.  
                </p>
                <p>For <a href="#Channel">Channel</a>s bound to <em>send</em>  
                    <a href="#ActionBinding">ActionBinding</a>s that can be secured using 
                    certificates:</p>
                <ul>
                    <li>The <a href="#SigningCertificateRef">SigningCertificateRef</a> element
                        specifies the default certificate for message layer signing.
                    </li>
                    <li>The <a href="#EncryptionTrustAnchorSetRef">EncryptionTrustAnchorSetRef</a> element 
                        specifies the default trust anchor set for any certificate to be used for 
                        message layer encryption.</li>
                </ul>
                <p>For <a href="#Channel">Channel</a>s bound to <em>receive</em>  
                    <a href="#ActionBinding">ActionBinding</a>s that can be secured using 
                    certificates:</p>
                <ul>
                    <li>The <a href="#EncryptionCertificateRef">EncryptionCertificateRef</a> element
                        specifies the default certificate for message layer encryption. </li>
                    <li>The <a href="#SigningTrustAnchorSetRef">SigningTrustAnchorSetRef</a> element
                        specifies the default trust anchor set for any certificate to be used for 
                        message layer signing.</li>
                </ul>
                <p>For a Transport for which a Party acts as Server:</p>
                <ul>
                    <li>The <a href="#ServerCertificateRef">ServerCertificateRef</a> specifies 
                        the default server authentication certificate.</li>
                    <li>The <a href="#ClientTrustAnchorSetRef">ClientTrustAnchorSetRef</a>
                        specifies the default client trust anchor.</li>
                </ul>
                <p>For a Transport for which a Party acts as Client:</p>
                <ul>
                    <li>The <a href="#ClientCertificateRef">ClientCertificateRef</a> 
                        specifies the default client authentication certificate.</li>
                    <li>The <a href="#ServerTrustAnchorSetRef">ServerTrustAnchorSetRef</a>
                        specifies the default server trust anchor.</li>
                </ul>
                <p>For the purpose of forming a CPA from two CPPs, a definition in a CPP 
                    of a <a href="#Channel">Channel</a>
                    for which a certificate or trust anchor for a <a href="#Party">Party</a> for 
                    signing or encryption 
                    is explicitly specified at the 
                    level of a <a href="#ChannelFeature">ChannelFeature</a> for that 
                    <a href="#Channel">Channel</a>    
                    is equivalent to a <a href="#Channel">Channel</a> for which the certificate 
                    or trust anchor 
                    is not specified for the purpose at the 
                    level of a <a href="#ChannelFeature">ChannelFeature</a> for that 
                    <a href="#Channel">Channel</a> 
                    but is specified for the purpose in the
                    <a href="#CertificateDefaults">CertificateDefaults</a> for the 
                    <a href="#Party">Party</a> .
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:SigningCertificateRef" minOccurs="0"/>
                <xs:element ref="cppa:SigningTrustAnchorSetRef" minOccurs="0"/>
                <xs:element ref="cppa:SigningCertificatePolicySetRef" minOccurs="0"/>
                <xs:element ref="cppa:EncryptionCertificateRef" minOccurs="0"/>
                <xs:element ref="cppa:EncryptionTrustAnchorSetRef" minOccurs="0"/>
                <xs:element ref="cppa:EncryptionCertificatePolicySetRef" minOccurs="0"/>
                <xs:element ref="cppa:ClientCertificateRef" minOccurs="0"/>
                <xs:element ref="cppa:ClientTrustAnchorSetRef" minOccurs="0"/>
                <xs:element ref="cppa:ClientCertificatePolicySetRef" minOccurs="0"/>
                <xs:element ref="cppa:ServerCertificateRef" minOccurs="0"/>
                <xs:element ref="cppa:ServerTrustAnchorSetRef" minOccurs="0"/>
                <xs:element ref="cppa:ServerCertificatePolicySetRef" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:complexType name="CertificatePolicySetReferenceType">
        <xs:annotation>
            <xs:documentation>
                <p>An reference to a set of certificate policies.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="setId" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A referenced identifier of a set of <a 
                            href="#CertificatePolicies">CertificatePolicies</a>.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>


    <xs:element name="TrustAnchorSet">
        <xs:annotation>
            <xs:documentation>
                <p>A <a href="#TrustAnchorSet">TrustAnchorSet</a> is a collection of trusted 
                    certificate roots. 
                    The TrustAnchorSet element MAY contain one or 
                    more <a href="#AnchorCertificateRef">AnchorCertificateRef</a>  
                    elements, each of which refers to a Certificate element (under 
                    <a href="#PartyInfo">PartyInfo</a> 
                    or <a href="#CounterPartyInfo">CounterPartyInfo</a>) 
                that represents a root certificate trusted by this Party. 
                These trusted root certificates are used in the 
                process of certificate path validation. If a certificate in question does not “chain” 
                to one of 
                this Party’s trust anchors, it is considered invalid.</p>
                <p>A <a href="#TrustAnchorSet">TrustAnchorSet</a> MAY also contain such a root 
                    certificate as direct child element.</p>
                <p>A <a href="#TrustAnchorSet">TrustAnchorSet</a> can be referenced 
                    using <a href="#SigningTrustAnchorSetRef">SigningTrustAnchorSetRef</a>, 
                    <a href="#EncryptionTrustAnchorSetRef">EncryptionTrustAnchorSetRef</a>, 
                    <a href="#ClientTrustAnchorSetRef">ClientTrustAnchorSetRef</a> 
                    and <a href="#ServerTrustAnchorSetRef">ServerTrustAnchorSetRef</a> elements in 
                    channel or transport binding definitions,
                    and taken into account during <a href="#CPA">CPA</a> formation. In
                    forming a <a href="#CPA">CPA</a>, a presented certificate MUST be matched 
                    against a referenced anchor.  The
                    <a href="#TrustAnchorSet">TrustAnchorSet</a> itself is not REQUIRED to be present 
                    in the generated <a href="#CPA">CPA</a>, as the selected 
                    certificate is trusted directly and specified in the <a href="#CPA">CPA</a>.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:choice minOccurs="1" maxOccurs="unbounded">
                    <xs:element ref="cppa:AnchorCertificateRef"/>
                    <xs:element ref="cppa:Certificate"/>
                </xs:choice>
            </xs:sequence>
            <xs:attribute name="id" type="xs:ID" use="required">
                <xs:annotation>
                    <xs:documentation>
                        <p>Unique identifier of the set of trusted anchor certificates</p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="CertificatePolicySet">
        <xs:annotation>
            <xs:documentation>
                <p>A set of accepted certificate policies, identified using 
                    <em>OID</em> in dotted string notation.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="CertificatePolicy" minOccurs="1" maxOccurs="unbounded">
                    <xs:simpleType>
                        <xs:restriction base="xs:string">
                            <xs:pattern value="([0-9]+\.)*[0-9]+"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:element>
            </xs:sequence>
            <xs:attribute name="id" type="xs:ID" use="required">
                <xs:annotation>
                    <xs:documentation>
                        <p>Unique identifier of the set of accepted certificate policies</p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="IDPRegistration">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#IDPRegistration">IDPRegistration</a> element represents a 
                    registration of a Party with an Identity Service Provider. This element can be 
                    used by parties in conjunction with a channel that uses SAML tokens to  select an 
                    IDP to obtain the token from. 
                </p>
                <p>The mandatory <a href="#ProviderID">ProviderID</a> is an Entity Identifier (see 
                    [SAML-CORE-2.0-OS], section 8.3.6) that uniquely 
                    identifies the identity provider</p>
                <p/>
                <p>The optional <a href="#Endpoint">Endpoint</a> is the Endpoint URI of the identity 
                    provider.</p>
                <p>The optional <a href="#ReceiverID">ReceiverID</a> represents the identity under 
                    which a party is known by the IDP. It is REQUIRED for any party that receives messages 
                    using a channel that requires information from the IDP.
                </p>
                <p>The element corresponds to <em>/sp:SamlToken/sp:Issuer</em> in WS-SecurityPolicy 
                    [WSSecurityPolicy13].</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:ProviderID"/>
                <xs:element ref="cppa:IDPName" minOccurs="0"/>
                <xs:element ref="cppa:Endpoint" minOccurs="0"/>
                <xs:element ref="cppa:ReceiverID"/>
            </xs:sequence>
            <xs:attribute name="id" type="xs:ID" use="required">
                <xs:annotation>
                    <xs:documentation>
                        <p>Unique identifier of the IDP registration</p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="IDPName" type="xs:string">
        <xs:annotation>
            <xs:documentation>The <a href="#IDPName">IDPName</a> provides a human-readable name 
                for an identity provider.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ProviderID" type="xs:anyURI">
        <xs:annotation>
            <xs:documentation>
                <p>The mandatory <a href="#ProviderID">ProviderID</a> is an Entity Identifier 
                    (see [SAML-CORE-2.0-OS], section 8.3.6) that uniquely 
                    identifies the identity provider.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ReceiverID" type="xs:anyURI">
        <xs:annotation>
            <xs:documentation>
                <p>The mandatory <a href="#ReceiverID">ReceiverID</a> is an Entity Identifier 
                    (see [SAML-CORE-2.0-OS], section 8.3.6) that specifies the identity under which a 
                    Party is registered with the identity provider.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="IDPRegistrationRef">
        <xs:annotation>
            <xs:documentation>A reference to a trusted Identity Provider.</xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attribute name="idp" type="xs:IDREF" use="required"/>
        </xs:complexType>
    </xs:element>


    <xs:element name="IDPRegistrationSet">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#IDPRegistrationSet">IDPRegistrationSet</a> bundles a set of 
                    IDP registrations and provides an identifier
                    that can be referenced by channels. Multiple registration sets MAY be specified, 
                    for example to support cases where different sets of registrations apply to 
                    different channels.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:IDPRegistrationRef" minOccurs="1" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="id" type="xs:ID" use="required">
                <xs:annotation>
                    <xs:documentation>
                        <p>Unique identifier of the set of IDP registrations</p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>


    <xs:element name="IDPRegistrationSetRef" type="cppa:IDPRegistrationSetRefType"
        substitutionGroup="cppa:SecurityTokenRef">
        <xs:annotation>
            <xs:documentation>
                <p>A reference to a set of IDP registrations</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="IDPRegistrationSetRefType">
        <xs:annotation>
            <xs:documentation>
                <p>Type definition of reference to a set of IDP registrations.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:SecurityTokenRefType">
                <xs:attribute name="idpsetid" type="xs:IDREF" use="required"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    
    <!-- SSH keys and key references --> 

    <xs:element name="SSHKey" substitutionGroup="cppa:SecurityToken">
        <xs:annotation>
            <xs:documentation>
                <p>A Public Key for use with SSH2 [RFC4254].
                    The content of the public key MUST be included
                    as a <em>KeyInfo/KeyValue/DSAKeyValue</em> or
                    <em>KeyInfo/KeyValue/RSAKeyValue</em> element. 
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:SecurityTokenType">
                    <xs:choice>
                        <xs:element ref="ds:KeyInfo"/>
                    </xs:choice>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="SSHClientKeyRef" substitutionGroup="cppa:SecurityTokenRef">
        <xs:annotation>
            <xs:documentation>
                <p>A reference to use of an SSH key for SSH client authentication.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:SecurityTokenRefType">
                    <xs:attribute name="keyId" type="xs:IDREF" use="required"/>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>
    
    <xs:element name="SSHServerKeyRef" substitutionGroup="cppa:SecurityTokenRef">
        <xs:annotation>
            <xs:documentation>
                <p>A reference to use of an SSH key for SSH server authentication.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:SecurityTokenRefType">
                    <xs:attribute name="keyId" type="xs:IDREF" use="required"/>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>
    
    
    <!-- Service Specification -->

    <xs:element name="ServiceSpecification">
        <xs:annotation>
            <xs:documentation>
                <p>This element associates a party with a <em>Service</em> and a binding (or bindings) 
                    supporting the participation of the party in a particular role in one or multiple business 
                    collaborations, collaborating with other parties acting in another particular role.
                </p>
                <p>In a <a href="#CPP">CPP</a>, 
                    <a href="#PartyRole">PartyRole</a> specifies the role of the party defined in 
                    <a href="#PartyInfo">PartyInfo</a>.
                    <a href="#CounterPartyRole">CounterPartyRole</a> specifies the role of an unspecified 
                    party with whom the party MAY engage in message exchange. 
                    
                </p>
                <p>In a <a href="#CPA">CPA</a>, 
                    <a href="#PartyRole">PartyRole</a> specifies the role of the party defined in 
                    <a href="#PartyInfo">PartyInfo</a> 
                    and <a href="#CounterPartyRole">CounterPartyRole</a> 
                    specifies the role of the party defined in <a href="#CounterPartyInfo">CounterPartyInfo</a>. 
                    
                </p>
                <p>In a <a href="#CPP">CPP</a> or <a href="#CPA">CPA</a> document, for an ordered 
                    pair or &lt;<a href="#PartyRole">PartyRole</a>, <a href="#CounterPartyRole">CounterPartyRole</a>&gt; 
                    all <a href="#ServiceBinding">ServiceBinding</a>s for that pair MUST be contained within a 
                    single <a href="#ServiceSpecification">ServiceSpecification</a>.</p>
                
                <p>In CPPA2, the equivalent of this element was called <em>CollaborationRole</em>.</p>
                <p>The element <a href="#CounterPartyRole">CounterPartyRole</a> has no equivalent in CPPA2. 
                    It is added the CPPA3 schema to facilitate
                    automated <a href="#CPA">CPA</a> formation in business processes involving more than two roles.  
                    For example:  In a collaboration involving roles <em>A</em>, <em>B</em> and <em>C</em>,  
                    some message types may be exchanged between <em>A</em> and <em>B</em>, others between 
                    <em>A</em> and <em>C</em> and others between <em>B</em> and <em>C</em>.  Therefore in CPPA3 
                    a <a href="#ServiceSpecification">ServiceSpecification</a>s specifies the involved role pair. 
                </p>
                <p>The <a href="#ServiceSpecificationExtension">ServiceSpecificationExtension</a> element is 
                    provided to allow extensibility of 
                    <a href="#ServiceSpecification">ServiceSpecification</a> elements.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:Description" minOccurs="0"/>
                <xs:element ref="cppa:PartyRole"/>
                <xs:element ref="cppa:CounterPartyRole"/>
                <xs:element ref="cppa:ServiceBinding" maxOccurs="unbounded"/>
                <xs:element ref="cppa:ServiceSpecificationExtension" minOccurs="0"
                    maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="base" type="xs:anyURI" use="optional">
                <xs:annotation>
                    <xs:documentation>
                        <p>This attribute kan be used to reference a business process definition document, 
                            for example an OASIS ebBP schema document [ebBP]. Any references to collaborations, 
                            transactions and roles in dependent <a href="#ServiceBinding">ServiceBinding</a> 
                            elements are to be interpreted relative to this schema. 
                        </p>
                        <p>This attribute serves the same purpose as the 
                            use of <em>ProcessSpecification/ds:Reference</em> in CPPA2.</p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="uuid" type="cppa:non-empty-string">
                <xs:annotation>
                    <xs:documentation>
                        <p>This attribute uniquely identifies the business process associated with the 
                            <a href="#ServiceSpecification">ServiceSpecification</a>.  
                            If an ebBP document is referenced using the <em>base</em> attribute, 
                            this value MUST match the UUID specified for a process contained in the referenced 
                            ebBP document.
                        </p>
                        <p>This attribute is equivalent to the CPPA2 <em>ProcessSpecification/@uuid</em> 
                            attribute.</p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="name" type="cppa:non-empty-string">
                <xs:annotation>
                    <xs:documentation>
                        <p>This attribute defines the name of the business process associated with the service 
                            collaboration. If an ebBP document is referenced using the <em>base</em> attribute, 
                            this value MUST match the name specified for a process contained in the referenced 
                            ebBP document.
                        </p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="version" type="cppa:non-empty-string">
                <xs:annotation>
                    <xs:documentation>
                        <p>This attribute defines the version of the business process associated with the 
                            service collaboration. 
                        </p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attributeGroup ref="cppa:acl_attributes"/>
        </xs:complexType>
    </xs:element>


    <xs:element name="ServiceSpecificationExtension" abstract="true"
        type="cppa:ServiceSpecificationExtensionType">
        <xs:annotation>
            <xs:documentation>An abstract ServiceSpecification Extension element</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ServiceSpecificationExtensionType" abstract="true">
        <xs:annotation>
            <xs:documentation>An abstract ServiceSpecification Extension type</xs:documentation>
        </xs:annotation>
    </xs:complexType>


    <xs:element name="PartyRole" type="cppa:RoleType">
        <xs:annotation>
            <xs:documentation>
                <p>This element identifies the role of the party involved in the service collaboration
                    in the sibling <a href="#ServiceBinding">ServiceBinding</a> elements.</p>
                <p>With ebMS2 and ebMS3, this value is used in the <em>eb:From/eb:Role</em> or 
                    <em>eb:To/Role</em> headers. </p>
                <p>With ebMS3, depending on the exchange binding, this element corresponds to one of the
                    <em>PMode.Initiator.Role</em> or <em>PMode.Responder.Role</em> parameters.  
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="CounterPartyRole" type="cppa:RoleType">
        <xs:annotation>
            <xs:documentation>
                <p>This element identifies the role of the counterparty involved in the service collaboration 
                    in the sibling <a href="#ServiceBinding">ServiceBinding</a> elements.</p>
                <p>With ebMS2 and ebMS3, this value is used in <em>From/Role</em> or <em>To/Role</em> headers. </p>
                <p>With ebMS3,  depending on the exchange binding, this element corresponds to one of the
                    <em>PMode.Initiator.Role</em> or <em>PMode.Responder.Role</em> elements.  
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="RoleType">
        <xs:attribute name="name" type="cppa:non-empty-string" use="required">
            <xs:annotation>
                <xs:documentation>
                    <p>For <a href="#ServiceBinding">ServiceBinding</a>s associated with a business process, 
                        the value of this attribute MUST match a defined role in the business process.  
                    </p>
                    <p>When used in combination with an ebBP process definition, the value of this attribute MUST 
                        match a <em>BusinessCollaboration/Role/@name</em>, <em>BinaryCollaboration/Role/@name</em>
                        or <em>MultiPartyCollaboration/Role/@name</em> value.
                    </p>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:element name="ServiceBinding">
        <xs:complexType>
            <xs:annotation>
                <xs:documentation>
                    <p>A <a href="#ServiceBinding">ServiceBinding</a> specifies a <a href="#Service">Service</a> 
                        and provides a binding of its actions. If a business process is referenced in the
                        parent <a href="#ServiceSpecification">ServiceSpecification</a>, this element
                        establishes the requesting and responding business activities 
                        in a business process definition that describe the actions to be implemented.
                    </p>
                    <p>It is possible to specify the <a href="#ActivationDate">ActivationDate</a> for a <a href="#ServiceBinding">ServiceBinding</a>, if its value is later than the value of the
                        <a href="#ActivationDate">ActivationDate</a> of the containing 
                        <a href="#CPP">CPP</a> or <a href="#CPA">CPA</a>.
                    </p>
                    <p>Similarly, it is possible to specify the <a href="#ExpirationDate">ExpirationDate</a> for a <a href="#ServiceBinding">ServiceBinding</a>, if its value is earlier than the value of the
                        <a href="#ExpirationDate">ExpirationDate</a> of the containing 
                        <a href="#CPP">CPP</a> or <a href="#CPA">CPA</a>.
                    </p>
                    <p>The <a href="#ServiceBindingExtension">ServiceBindingExtension</a> element is provided to 
                        allow extensibility of <a href="#ServiceBinding">ServiceBinding</a> elements.</p>
                </xs:documentation>
            </xs:annotation>
            <xs:sequence>
                <xs:element ref="cppa:Description" minOccurs="0"/>
                <xs:element ref="cppa:Service"/>
                <xs:element ref="cppa:ActivationDate" minOccurs="0"/>
                <xs:element ref="cppa:ExpirationDate" minOccurs="0"/>
                <xs:element ref="cppa:ActionBinding" maxOccurs="unbounded"/>
                <xs:element ref="cppa:ServiceBindingExtension" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attributeGroup ref="cppa:acl_attributes"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="ServiceBindingExtension" abstract="true"
        type="cppa:ServiceBindingExtensionType">
        <xs:annotation>
            <xs:documentation>An abstract ServiceBinding Extension element</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ServiceBindingExtensionType" abstract="true">
        <xs:annotation>
            <xs:documentation>An abstract ServiceBinding Extension type</xs:documentation>
        </xs:annotation>
    </xs:complexType>

    <xs:element name="Service">
        <xs:annotation>
            <xs:documentation>
                <p>This element identifies the service that acts on the message. Its actual semantics is beyond 
                    the scope of this specification. Its value MUST be agreed and interpreted consistently by 
                    a party and its counterparties. The designer of a service may be a standards organization or 
                    industry, an individual or enterprise.</p>
                <p>In ebMS3, this element corresponds to the <em> PMode[1].BusinessInfo.Service</em> 
                    parameter.</p>    
                <p>When used for a business process defined in ebBP, the value of this element
                    SHOULD match a <em>BusinessCollaboration/@name</em>, <em>BinaryCollaboration/@name</em> 
                    or <em>MultiPartyCollaboration/@name</em> value in the context of the referenced 
                    ebBP document.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="cppa:non-empty-string">
                    <xs:attribute name="type" type="cppa:non-empty-string">
                        <xs:annotation>
                            <xs:documentation><p>The attribute define a service type.</p></xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="ActionBinding">
        <xs:annotation>
            <xs:documentation>
                <p>An <a href="#ActionBinding">ActionBinding</a> defines a binding for an <em>action</em> 
                    in a service. Its actual semantics is beyond the scope of this specification. 
                    Like the ebMS3 concept of a <em>processing mode</em>, the binding controls the 
                    way messages are processed and provides a configuration that is common to a set of messages 
                    exchanged among parties.  
                </p>
                <p>This version of CPPA
                    supports actions in <em>One Way</em> exchanges and pairs of actions in <em>Two Way</em> 
                    exchanges. An action in a One Way exchange is an action that is not followed by another action 
                    that explicitly relates to the One Way exchange action.  In Two Way exchanges, one action is 
                    expected to be followed by another action that explicitly relates to it. This other action 
                    MUST reference the action it relates to using the <em>replyTo</em> attribute.  The interpretation of 
                    situations in which there are multiple <a href="#ActionBinding">ActionBinding</a>s that are 
                    replies to the same  <a href="#ActionBinding">ActionBinding</a>,  
                    is outside the scope of this specification. They may constitute alternative responses.  
                    For example, a <em>SubmitOrder</em> action may be replied to by an <em>AcceptOrder</em> action or 
                    a <em>RejectOrder</em> action.
                    When used for actions defined in an ebBP schema document, a One Way exchange corresponds to a 
                    <em>RequestingBusinessActivity</em>.  A Two Way exchange corresponds to a 
                    <em>RequestingBusinessActivity</em> and the corresponding <em>RespondingBusinessActivity</em>
                </p>
                <p>An <a href="#ActionBinding">ActionBinding</a> corresponds with an ebMS3 One Way MEP (identified as 
                    <em>http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/oneWay</em>) 
                    if there is no other <a href="#ActionBinding">ActionBinding</a>  that refers to it using the 
                    <em>replyTo</em> attribute.</p>
                <p>An ebMS3 Two Way MEP 
                    (identified as <em>http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/twoWay</em>) 
                    corresponds to a collection of at least two <a href="#ActionBinding">ActionBinding</a>s. 
                    Exactly one of these MUST 
                    NOT have a <em>replyTo</em> attribute. This constitutes the first leg in the MEP. All other 
                    <a href="#ActionBinding">ActionBinding</a>s in this collection relate to the second leg in 
                    the message exchange. 
                    They MUST have a <em>replyTo</em> reference to the <a href="#ActionBinding">ActionBinding</a> corresponding 
                    to the first leg. 
                    For ebMS3, specification of alternative responses is 
                    <a href="https://issues.oasis-open.org/browse/EBXMLMSG-74">an issue</a> to possibly 
                    be addressed in a future errata.                    
                </p>
                <p><a href="#ActionBinding">ActionBinding</a> elements with values <em>send</em> 
                    or <em>receive</em> for the
                    <em>sendOrReceive</em> attribute correspond to the CPPA version 2.0 <em>CanSend</em> 
                    and <em>CanReceive</em> elements, respectively. </p>                
                <p>In a <a href="#CPP">CPP</a>, an <a href="#ActionBinding">ActionBinding</a> is associated 
                    with one or multiple channels,
                    identified using their <a href="#ChannelId">ChannelId</a>. If there is more than one
                    reference to a 
                    channel, the presented channels are alternatives, with preferred bindings preceding 
                    less preferred alternatives.  For example, a party may offer an ebMS3 channel that is
                    preferred as well as an ebMS2 channel that is supported for legacy connections.  
                </p>
                <p>In a <a href="#CPA">CPA</a>, there MUST be exactly one <a href="#ChannelID">ChannelID</a>, 
                    covering the channel for both parties. </p>
                
                <p>In a <a href="#CPP">CPP</a>, the CPPA3 schema associates an <a href="#ActionBinding">ActionBinding</a> 
                    with zero or multiple payload profiles, identified using a 
                    <a href="#PayloadProfileId">PayloadProfileId</a>. If there is more than one
                    reference to a 
                    payload profile, the presented payload profiles are alternatives, 
                    with preferred bindings preceding 
                    less preferred alternatives.  
                    In the absence of any <a href="#PayloadProfileId">PayloadProfileId</a> elements, 
                    there are no contraints on payloads that are exchanged.</p>
                <p>In a <a href="#CPA">CPA</a>, there MUST be at most one 
                    <a href="#PayloadProfileId">PayloadProfileId</a>, 
                    covering the payload profile that both parties agree to use.
                    In the absence of any <a href="#PayloadProfileId">PayloadProfileId</a> elements, 
                    there are no contraints on payloads that are exchanged.
                </p>
                
                <p>When a <a href="#CPA">CPA</a> is used in combination with the ebMS2 or ebMS3 messaging 
                    protocols, the <em>Service</em> 
                    and <em>Action</em> message headers and the <a href="#Service">Service</a> element content 
                    and the <em>action</em> attribute of <a href="#ActionBinding">ActionBinding</a>
                    in the CPA can be linked to infer the applicable <a href="#ActionBinding">ActionBinding</a>, with its 
                    <a href="#Channel">Channel</a> and <a href="#PayloadProfile">PayloadProfile</a>. 
                    This mapping is unambiguous if,  
                    in the context of an <a href="#ServiceBinding">ServiceBinding</a>, 
                    only a single <a href="#ActionBinding">ActionBinding</a> exists for any 
                    given pair of values for the <em>action</em> and 
                    <em>sendOrReceive</em> attributes. 
                </p>
                
                <p>An <a href="#ActionBinding">ActionBinding</a> MAY contain <a href="#Property">Property</a> 
                    elements that associate additional
                    metadata with the messages.  
                    
                    The semantics of these elements 
                    MAY depend on the <a href="#Service">Service</a> context of the 
                    <a href="#ActionBinding">ActionBinding</a>.
                </p>
                <p>The use of <a href="#Property">Property</a> elements MAY depend on the messaging protocol used.
                    In ebMS3, the elements control the use of Message Properties. In AMQP, they map to 
                    AMQP Application Properties.
                </p>
                <p>
                    Sets of <a href="#Property">Property</a> elements MAY also be referenced using 
                    the <em>propertySetId</em> attribute.
                    If any <a href="#Property">Property</a> elements are present, the <em>propertySetId</em> 
                    attribute MUST NOT be 
                    present.
                </p>
                <p>The <a href="#ActionBindingExtension">ActionBindingExtension</a> element is provided to allow 
                    extensibility of <a href="#ActionBinding">ActionBinding</a> elements.</p>
                
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:ChannelId" maxOccurs="unbounded"/>
                <xs:element ref="cppa:PayloadProfileId" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:Property" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:ActionBindingExtension" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="id" type="xs:ID" use="required">
                <xs:annotation>
                    <xs:documentation>
                        <p>The <em>id</em> attribute identifies an <a href="#ActionBinding">ActionBinding</a>
                            in the context of a CPPA3 document.  
                            This enables cross-references between actions using the <em>replyTo</em> attribute.
                            The attribute can also serve a similar purpose to 
                            the ebMS3 <em>PMode.ID</em> parameter, however the ebMS3 parameter is common to the two
                            legs in a Two Way MEP, whereas the CPPA3 attribute is specific to a particular leg.</p>                
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="action" type="xs:anyURI" use="required">
                <xs:annotation>
                    <xs:documentation>
                        <p>When used for actions defined in an ebBP schema document, the value of this 
                            attribute SHOULD match a <em>RequestingBusinessActivity/@name</em> or
                            <em>RespondingBusinessActivity/@name</em> value.
                        </p>
                        <p>When used with ebMS3, the <em>action</em> attribute corresponds to the 
                            ebMS3 <em>PMode[1].BusinessInfo.Action</em> parameter.</p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="businessTransactionActivity" type="cppa:non-empty-string">
                <xs:annotation>
                    <xs:documentation>
                        <p>When used for actions defined in an ebBP schema document, the value of this 
                            attribute MUST match <em>ComplexBusinessTransactionActivity/@name</em> or
                            <em>BusinessTransactionActivity/@name</em>
                        </p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="collaborationActivity" type="cppa:non-empty-string">
                <xs:annotation>
                    <xs:documentation>
                        <p>When used for actions defined in an ebBP schema document, the value of this 
                            attribute MUST match a defined <em>CollaborationActivity/@name</em>.
                        </p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="requestOrResponseAction" type="cppa:non-empty-string">
                <xs:annotation>
                    <xs:documentation>
                        <p>When used for actions defined in an ebBP schema document, the value of this 
                            attribute MUST match a defined <em>RequestingBusinessActivity/@name</em>
                            or the <em>RespondingBusinessActivity/@name</em>.
                        </p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attributeGroup ref="ebbp:quality">
                <xs:annotation>
                    <xs:documentation>
                        <p>This attribute group specifies business quality of service attributes for the action.</p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attributeGroup>
            <xs:attribute name="sendOrReceive" use="required" type="cppa:send_or_receive_type">
                <xs:annotation>
                    <xs:documentation>
                        <p>This attribute specifies the directionality of the action, from the perspective of the Party. 
                            In a pair of actions in a Two Way exchange, if the value of 
                            <em>sendOrReceive</em> for the first 
                            action is <em>send</em>, the second action MUST have the value 
                            <em>receive</em> and vice versa.  
                        </p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="replyTo" type="xs:IDREF" use="optional">
                <xs:annotation>
                    <xs:documentation>
                        <p>This attribute MAY be used to express that an action is a response to some 
                            other action and to identify that action. When bound to ebMS2 or ebMS3,
                            this attribute also expresses that on messages for this action 
                            a <em>RefToMessageId</em> element is REQUIRED. 
                        </p>
                        <p>If <a href="#ActionBinding">ActionBinding</a> X references another 
                            <a href="#ActionBinding">ActionBinding</a> Y 
                            using <em>replyTo</em>, then Y MUST NOT itself 
                            reference any other <a href="#ActionBinding">ActionBinding</a> Z. 
                        </p>
                        <p>A referenced <a href="#ActionBinding">ActionBinding</a> MUST be a 
                            sibling element, i.e. it MUST be
                            contained in the same <a href="#ServiceBinding">ServiceBinding</a>. 
                            As a consequence, when used with
                            ebMS2 or ebMS3, the value for the <em>Service</em> header field will be the same for
                            both legs in a Two Way MEP.  Also see <a href="https://issues.oasis-open.org/browse/EBXMLMSG-73">https://issues.oasis-open.org/browse/EBXMLMSG-73</a>.
                        </p>
                        <p>When used for actions defined in an ebBP schema document, this attribute MUST be
                            present on actions representing a <em>RespondingBusinessActivity</em> and MUST
                            reference an <em>ActionBinding/@id</em> for the corresponding 
                            <em>RequestingBusinessActivity</em>.
                        </p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="use" use="optional" default="required" type="cppa:usetype">
                <xs:annotation>
                    <xs:documentation>
                        <p>This attribute MUST NOT be used in a <a href="#CPA">CPA</a>. 
                            It MAY be used in a <a href="#CPP">CPP</a> to express whether
                            or not support for the action is required, in the context of a containing 
                            <a href="#ServiceBinding">ServiceBinding</a>. 
                            If a <a href="#CPP">CPP</a> specifies its use as optional, the 
                            other <a href="#CPP">CPP</a> 
                            does not have to provide an <a href="#ActionBinding">ActionBinding</a> 
                            for the <em>action</em> for 
                            the match of the service binding to succeed.  
                        </p>
                        <p>If the other <a href="#CPP">CPP</a> does provide an 
                            <a href="#ActionBinding">ActionBinding</a> for that action that does 
                            not specify its <em>use</em> to be <em>optional</em>, then the two 
                            <a href="#ActionBinding">ActionBinding</a>s MUST match for the 
                            <a href="#ServiceBinding">ServiceBinding</a> to match.                            
                        </p>
                        <p>If the other <a href="#CPP">CPP</a> does provide an <a href="#ActionBinding">ActionBinding</a> for that action that 
                            specifies its <em>use</em> to be <em>optional</em>, then the two <a href="#ActionBinding">ActionBinding</a>s 
                            are not REQUIRED to match. If there is a match, the result of the match MUST be
                            included in the resulting <a href="#ServiceBinding">ServiceBinding</a>.
                        </p>
                        <p>Absence of this attribute in a <a href="#CPP">CPP</a> is equivalent 
                            to it being present with value 
                            <em>required</em>, i.e. by default specified actions are required within the
                            scope of a service binding.</p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="propertySetId" type="xs:IDREF">
                <xs:annotation>
                    <xs:documentation>A reference to a <a href="#PropertySet">PropertySet</a>. 
                        If this attribute is present in an 
                        <a href="#ActionBinding">ActionBinding</a>, there MUST NOT be 
                        any <a href="#Property">Property</a> child elements.
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attributeGroup ref="cppa:acl_attributes"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="ActionBindingExtension" abstract="true" type="cppa:ActionBindingExtensionType">
        <xs:annotation>
            <xs:documentation>An abstract ActionBinding Extension element</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ActionBindingExtensionType" abstract="true">
        <xs:annotation>
            <xs:documentation>An abstract ActionBinding Extension type</xs:documentation>
        </xs:annotation>
    </xs:complexType>


    <xs:simpleType name="send_or_receive_type">
        <xs:restriction base="xs:token">
            <xs:enumeration value="send"/>
            <xs:enumeration value="receive"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:element name="PayloadProfileId" type="xs:IDREF">
        <xs:annotation>
            <xs:documentation>
                <p>A <a href="#PayloadProfileId">PayloadProfileId</a> identifies a payload profile that MAY be 
                    used in the exchange of message for an <a href="#ActionBinding">ActionBinding</a>.  </p>
                <p>In a <a href="#CPP">CPP</a>, multiple occurrences of <a href="#PayloadProfileId">PayloadProfileId</a> MAY be specified in 
                    an <a href="#ActionBinding">ActionBinding</a>.  A sequence of 
                    two or more <a href="#PayloadProfileId">PayloadProfileId</a> elements expresses alternative 
                    payload profiles which the party is willing to use for 
                    the <a href="#ActionBinding">ActionBinding</a>.  The semantics 
                    of the order corresponds to a preference. If <a href="#PayloadProfileId">PayloadProfileId</a> <b>X</b> 
                    preceeds <a href="#PayloadProfileId">PayloadProfileId</a> <b>Y</b> within the scope of an <a href="#ActionBinding">ActionBinding</a>, then the 
                    Party prefers use of <b>X</b> over <b>Y</b> for the specified action.  
                </p>
                <p>In a <a href="#CPA">CPA</a>, at most 
                    one <a href="#PayloadProfileId">PayloadProfileId</a> MUST be present. 
                    It identifies the payload profile that 
                    Party and CounterParty agree to bind the specified action to.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ChannelId" type="xs:IDREF">
        <xs:annotation>
            <xs:documentation>
                <p>A <a href="#ChannelId">ChannelId</a> identifies a channel that MAY be used to exchange 
                    a message in the context of a CPPA3 document.  </p>
                <p>In a <a href="#CPP">CPP</a>, multiple occurrences of <a href="#ChannelId">ChannelId</a> MAY be specified in an 
                    <a href="#ActionBinding">ActionBinding</a>.  A sequence of 
                    two or more <a href="#ChannelId">ChannelId</a> elements expresses alternative 
                    channels which the party is willing to use for the message exchange.  The semantics 
                    of the order corresponds to a preference. If <a href="#ChannelId">ChannelId</a> <b>X</b> 
                    preceeds <a href="#ChannelId">ChannelId</a> <b>Y</b> within the scope of an <a href="#ActionBinding">ActionBinding</a>, then the 
                    Party prefers use of <b>X</b> over <b>Y</b> for the specified action.  
                </p>
                <p>In a <a href="#CPA">CPA</a>, exactly one <a href="#ChannelId">ChannelId</a> MUST be present
                    in an <a href="#ActionBinding">ActionBinding</a>. 
                    It identifies the channel that 
                    Party and CounterParty agree to bind the specified action to.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- Message Channels -->

    <xs:element name="Channel" type="cppa:ChannelType" abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>A CPPA3 <a href="#Channel">Channel</a>  
                    configures the use of a messaging protocol for the exchange of user messages 
                    and/or signal messages. A channel can be bound to particular business actions in service 
                    collaborations between parties.  
                    A channel MAY be a point-to-point channel or end-to-end, 
                    for messaging protocols that support the concept, like ebMS3 using the multihop 
                    advanced feature [EBMS3PART2].  
                    This element is an abstract element. It is substituted by elements representing 
                    specific messaging protocols defined in this schema or in extensions of this schema.
                </p>
                <p>A channel MAY relate to other channels. For example, the channel for ebMS3 user 
                    messages MAY specify the use of another channel for the exchange of errors related to 
                    that user message.  
                </p>
                <p>A channel MAY be associated with a particular transport using 
                    the <em>transport</em> attribute.</p>
                <p>A channel MAY set the <em>asResponse</em> attribute to categorize a channel 
                    as a forward channel or as a backchannel.
                    A forward channel is initiated by the sender. 
                    A backchannel is a channel that is associated with some other channel that may not 
                    be initiated by the sender and that allows communication in the reverse direction. 
                    
                    The following list describes some common situations:</p>
                <ol>
                    <li>The <em>transport</em> attribute is present and the <em>asResponse</em> 
                        attribute is either absent or present with a false value. 
                        This expresses that the exchange uses the specified transport.
                    </li>
                    <li>The <em>transport</em> attribute is absent and the <em>asResponse</em> attribute 
                        is present with a true value.
                        This expresses that the exchange uses a backchannel of some other channel.  
                        Examples are synchronous responses or exchanges 
                        that use a channel created by a polling mechanism.
                    </li>
                </ol>
                <p>The <em>transport</em> and <em>asResponse</em> attributes 
                    are both absent in situations such as:</p>
                <ul>
                    <li>End-to-end channels that consist of multiple hops across a chain of 
                        store-and-forward messaging intermediaries. The transport differs for 
                        each hop and therefore cannot be expressed for the end-to-end channel.</li>
                    <li>Situations where the transport is computed dynamically.</li>
                </ul>
                <p>These situations are described more precisely in the documentation of 
                    non-abstract substitution elements.</p>
                <p>Compared to CPPA2, in which the corresponding element was called <em>DeliveryChannel</em>, 
                    the CPPA3 <a href="#Channel">Channel</a> element combines the Sender 
                    and Receiver Protocol Bindings, which 
                    in CPPA2 were contained in the <em>DocumentExchange</em> element.  
                    As this element has no other
                    children,  CPPA3 uses the substitutions for Protocol Binding directly to simplify and 
                    flatten the structure of the <a href="#CPP">CPP</a> and 
                    <a href="#CPA">CPA</a> elements. 
                    The <a href="#Transport">Transport</a> is referenced from 
                    the <a href="#Channel">Channel</a> directly.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ChannelType" abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>This is an abstract type covering channel bindings to message protocols. </p>
                <p>The <a href="#MaxSize">MaxSize</a> Specifies the maximum size of the payloads 
                    of message using a particular protocol binding. </p>
                <p>When used with ebMS3, the <a href="#MaxSize">MaxSize</a> element maps to 
                    <em>PMode[1].BusinessInfo.PayloadProfile.maxSize</em>.
                    In CPPA3 it is specified at <a href="#Channel">Channel</a> level rather 
                    than at <a href="#PayloadProfile">PayloadProfile</a> 
                    level, because the size limits can be protocol-specific.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="cppa:Description" minOccurs="0"/>
            <xs:element ref="cppa:ChannelProfile" minOccurs="0"/>
            <xs:element ref="cppa:MaxSize" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:ID" use="required">
            <xs:annotation>
                <xs:documentation>A unique identifier for the <a href="#Channel">Channel</a> for cross-referencing 
                    within the XML document.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="transport" type="xs:IDREF" use="optional">
            <xs:annotation>
                <xs:documentation>
                    <p>The <em>transport</em> attribute references a <a href="#Transport">Transport</a> 
                        to be used 
                        by the <a href="#Channel">Channel</a>.
                        This attribute MUST NOT be present if <em>asResponse</em> is set 
                        to <em>false</em>. Otherwise, 
                        requirements for presence or absence of this attribute depend on 
                        specific channel bindings. </p>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="asResponse" type="xs:boolean">
            <xs:annotation>
                <xs:documentation>
                    <p>Specifies if the channel is to use the backchannel of an underlying transport 
                        set up by another channel. This feature is specified further for 
                        subtypes of the channel element.  
                    </p>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="package" type="xs:IDREF" use="optional">
            <xs:annotation>
                <xs:documentation>
                    <p>The <em>package</em> attribute references a <em>Package</em> for 
                        a <a href="#Channel">Channel</a>.</p>
                    <p>This attribute MUST NOT be used for channels used for protocol message types 
                        that have a fixed and predictable format, such as receipts and erors.   
                    </p>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:element name="ChannelExtension" abstract="true" type="cppa:ChannelExtensionType">
        <xs:annotation>
            <xs:documentation>An abstract Channel Extension element</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ChannelExtensionType" abstract="true">
        <xs:annotation>
            <xs:documentation>An abstract Channel Extension type</xs:documentation>
        </xs:annotation>
    </xs:complexType>


    <xs:element name="ChannelProfile" type="xs:anyURI">
        <xs:annotation>
            <xs:documentation>
                <p>This element identifies a particular profile of the messaging protocol. 
                    For example, the AS4 ebHandler Conformance Profile of ebMS3 is identified 
                    using the URI 
                    <em>http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/cprofiles/200809/as4ebhandler</em>.</p>
                <p>In some communities using ebMS3, different profiles are used and selected using the
                    <em>AgreementRef</em> header field and <em>PMode.Agreement</em> parameter. A potential use
                    of <a href="#ChannelProfile">ChannelProfile</a> is to set this value.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- Channel Feature -->

    <xs:element name="ChannelFeature" abstract="true" type="cppa:ChannelFeatureType">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#ChannelFeature">ChannelFeature</a> element defines a 
                    reusable specification of a 
                    feature or aspect of a channel. It
                    is to be instantiated to specific features such as security or reliable messaging. 
                    Channel features MAY be specific to specific types of 
                    <a href="#Channel">Channel</a>s.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ChannelFeatureType" abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>This is an abstract type covering channel features. </p>
            </xs:documentation>
        </xs:annotation>
        <xs:attribute name="id" type="xs:ID">
            <xs:annotation>
                <xs:documentation>Identifier of the channel feature. This allows the feature to be reused 
                    in multiple channels. </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <!--  Named Channel Binding -->

    <xs:element name="NamedChannel" substitutionGroup="cppa:Channel">
        <xs:annotation>
            <xs:documentation>
                <p>The Named Channel provides a Channel identified using a Named Channel and supplies any named 
                    Parameters.  
                    Specific named channels MAY associate with or require specific parameters. The CPPA3 schema does not
                    constrain specific parameters and/or values. The Named Channel option assumes parties infer the 
                    protocol to be used and all or most configuration parameters for that protocol from a specified and 
                    mutually understood name. The type definition includes Signing and Encryption certification references,
                    which are inherently partner specific. Other parameters can be specified using 
                    <a href="#Param">Param</a> elements.
                    <a href="#NamedChannel">NamedChannel</a>s MAY be interpreted (and hence used) in one of two ways:
                </p>
                <ol>
                    <li>As a <em>macro</em> facility, to simplify the management of CPPs and CPAs that have
                        many largely identical protocol bindings. The named binding MAY be mapped to a a more complete
                        binding that defines additional configurations. 
                        The semantics of the element is defined in terms of the semantics of that binding. </li>
                    <li>To identify a particular configuration of some protocol that can be 
                        mapped to particular configurations in CPPA3 aware software. This can even be used for 
                        protocols for which the CPPA3 schema does not specify bindings.
                    </li>
                </ol>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:ChannelType">
                    <xs:sequence>
                        <xs:element ref="cppa:ChannelName"/>
                        <xs:element ref="cppa:SigningCertificateRef" minOccurs="0"/>
                        <xs:element ref="cppa:SigningCertificateRequired" minOccurs="0"/>
                        <xs:element ref="cppa:SigningTrustAnchorSetRef" minOccurs="0"/>
                        <xs:element ref="cppa:EncryptionCertificateRef" minOccurs="0"/>
                        <xs:element ref="cppa:EncryptionCertificateRequired" minOccurs="0"/>
                        <xs:element ref="cppa:EncryptionTrustAnchorSetRef" minOccurs="0"/>
                        <xs:element ref="cppa:Param" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="cppa:NamedChannelExtension" minOccurs="0"
                            maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="ChannelName" type="cppa:non-empty-string">
        <xs:annotation>
            <xs:documentation>The name of the channel used in the NamedChannel.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="Param">
        <xs:complexType>
            <xs:annotation>
                <xs:documentation>A parameter name/value pair.</xs:documentation>
            </xs:annotation>
            <!-- 
            <xs:sequence>
                <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"
                />
            </xs:sequence>
            -->
            <xs:attribute name="name" type="cppa:non-empty-string" use="required">
                <xs:annotation>
                    <xs:documentation>The name of the parameter.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>


    <xs:element name="NamedChannelExtension" abstract="true" type="cppa:NamedChannelExtensionType">
        <xs:annotation>
            <xs:documentation>An abstract NamedChannel extension element</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="NamedChannelExtensionType" abstract="true">
        <xs:annotation>
            <xs:documentation>An abstract NamedChannel extension type</xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:ChannelExtensionType"> </xs:extension>
        </xs:complexContent>
    </xs:complexType>



    <!-- EDIINT -->

    <xs:element name="EDIINTChannel" type="cppa:EDIINTChannelType" substitutionGroup="cppa:Channel"
        abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>This element defines an abstract EDIINT message channel. The element definition generalizes over the 
                    three EDIINT Application Statements for SMTP (AS1), HTTP (AS2) and FTP (AS3) [RFC3335, RFC4130, 
                    RFC4823]. 
                    Whether an EDIINT message is to be sent using AS1, AS2 or AS3 is selected by the 
                    choice of an <a href="#AS1Channel">AS1Channel</a>, <a href="#AS2Channel">AS2Channel</a> or 
                    <a href="#AS3Channel">AS3Channel</a> element. This choice instructs the messaging 
                    application using the CPPA3 document to apply the applicable Applicability Statement.
                </p>
                <p>The <a href="#Signature">Signature</a> element indicates that the EDIINT data is wrapped in a 
                    <em>multipart/signed</em> MIME structure. </p>
                <p>The <a href="#Encryption">Encryption</a> element indicates that the EDIINT data is wrapped in a 
                    <em>multipart/encrypted</em> MIME structure. </p>

                <p>For EDIINT, the <a href="#ReceiptHandling">ReceiptHandling</a> element configures the 
                    processing of EDIINT Message Disposition 
                    Notifications (MDNs). The configuration of receipt processing with EDIINT is specified in the
                    documentation of the <a href="#ReceiptHandling">ReceiptHandling</a> element.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="EDIINTChannelType">
        <xs:annotation>
            <xs:documentation>
                <p>This channel type definition generalizes over configurations of channels using 
                    EDIINT AS1, AS2 and AS3 [RFC3335, RFC4130, RFC4823].</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:ChannelType">
                <xs:sequence>
                    <xs:element ref="cppa:Signature" minOccurs="0"/>
                    <xs:element ref="cppa:Encryption" minOccurs="0"/>
                    <xs:element ref="cppa:ErrorHandling" minOccurs="0"/>
                    <xs:element ref="cppa:ReceiptHandling" minOccurs="0"/>
                    <xs:element ref="cppa:Compression" minOccurs="0"/>
                    <xs:element ref="cppa:EDIINTChannelExtension" minOccurs="0"
                        maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attribute name="version" type="cppa:non-empty-string" default="1.0">
                    <xs:annotation>
                        <xs:documentation>
                            <p>For AS2 or AS3, the version of the protocol used. 
                                Version number 1.1 indicates support for the [RFC5402] compression feature.
                                Version number 1.2 indicates support for the [RFC6017] features feature.
                            </p>
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="errorHandling" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#ErrorHandling">ErrorHandling</a> element. 
                            If this attribute is present, there MUST NOT be a 
                            child <a href="#ErrorHandling">ErrorHandling</a>.  </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="receiptHandling" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#ReceiptHandling">ReceiptHandling</a> element. 
                            If this attribute is present, there MUST NOT be a 
                            child <a href="#ReceiptHandling">ReceiptHandling</a>.  </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="EDIINTChannelExtension" abstract="true" type="cppa:EDIINTChannelExtensionType">
        <xs:annotation>
            <xs:documentation>An abstract EDIINTChannel extension element</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="EDIINTChannelExtensionType" abstract="true">
        <xs:annotation>
            <xs:documentation>An abstract EDIINTChannel extension type</xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:ChannelExtensionType"> </xs:extension>
        </xs:complexContent>
    </xs:complexType>


    <xs:element name="AS1Channel" type="cppa:EDIINTChannelType"
        substitutionGroup="cppa:EDIINTChannel">
        <xs:annotation>
            <xs:documentation>
                <p>This element configures a channel using EDIINT AS1 [RFC3335].</p>
                <p>As with any <em>EDIINT</em> channel, <a href="#ReceiptHandling">ReceiptHandling</a> 
                    configures the processing of
                    Message Disposition Notifications.
                </p>
                <p>An <a href="#AS1Channel">AS1Channel</a> MUST be bound to an <a href="#SMTPTransport">SMTPTransport</a> transport.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="AS2Channel" type="cppa:EDIINTChannelType"
        substitutionGroup="cppa:EDIINTChannel">
        <xs:annotation>
            <xs:documentation>
                <p>This element configures a channel using EDIINT AS2 [RFC4130].</p>
                <p>When using an AS2 channel, the <em>AS2-From</em> and <em>AS2-To</em> 
                    headers MUST be set to a Party/CounterParty 
                    <a href="#PartyId">PartyId</a> element content. 
                </p>
                <p>An <a href="#AS2Channel">AS2Channel</a> carrying business data MUST be 
                    bound to an <a href="#HTTPTransport">HTTPTransport</a> transport.</p>
                <p>An <a href="#AS2Channel">AS2Channel</a> carrying an MDN MUST</p>
                <ul>
                    <li>If bound to a transport, the transport SHOULD be an <a href="#HTTPTransport">HTTPTransport</a> transport. </li>
                    <li>If not bound to a transport, the <em>asResponse</em> attribute MUST be 
                        present with value <em>true</em>.</li>
                </ul>
                <p>As with any <em>EDIINT</em> channel, <a href="#ReceiptHandling">ReceiptHandling</a> configures the processing of
                    Message Disposition Notifications.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="AS3Channel" type="cppa:EDIINTChannelType"
        substitutionGroup="cppa:EDIINTChannel">
        <xs:annotation>
            <xs:documentation>
                <p>This element configures a channel using EDIINT AS3 [RFC4823].</p>
                <p>When using an AS3 channel, the <em>AS3-From</em> and <em>AS3-To</em> 
                    headers MUST be set to a Party/CounterParty 
                    <a href="#PartyId">PartyId</a> element content. 
                </p>
                <p>An <a href="#AS3Channel">AS3Channel</a> MUST be bound to an <a href="#FTPTransport">FTPTransport</a> transport.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- Web Services -->

    <xs:element name="WSChannel" type="cppa:WSChannelType" substitutionGroup="cppa:Channel">
        <xs:annotation>
            <xs:documentation>
                <p>This element configures a channel using Web Services. 
                    A Web Service Channel is a channel that uses SOAP 1.1 or SOAP 1.2 messaging. </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="WSChannelType">
        <xs:annotation>
            <xs:documentation>
                <p>A type definition of a Web Services channel.</p>
                <p>If multiple security binding elements are present, these MUST target 
                    different SOAP actors or roles.</p>
                <p>SOAPVersion is optional in situations where a <a href="#ChannelProfile">ChannelProfile</a> is specified that
                    fixes the version to use. This is the case, for example, in AS4 conformance profiles.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:ChannelType">
                <xs:sequence>
                    <xs:element ref="cppa:SOAPVersion" minOccurs="0"/>
                    <xs:element ref="cppa:FaultHandling" minOccurs="0"/>
                    <xs:element ref="cppa:Addressing" minOccurs="0"/>
                    <xs:element ref="cppa:WSSecurityBinding" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="cppa:ReliableMessagingBinding" minOccurs="0"/>
                    <xs:element ref="cppa:WSChannelExtension" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attribute name="securityBinding" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#WSSecurityBinding">WSSecurityBinding</a> element. If 
                            this attribute is present, there MUST NOT be a 
                            child <a href="#WSSecurityBinding">WSSecurityBinding</a>.  </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="reliableMessagingBinding" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#ReliableMessagingBinding">ReliableMessagingBinding</a> element. If 
                            this attribute is present, there MUST NOT be a 
                            child <a href="#ReliableMessagingBinding">ReliableMessagingBinding</a>.  
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="addressing" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#Addressing">Addressing</a> element. If 
                            this attribute is present, there MUST NOT be a 
                            child <a href="#Addressing">Addressing</a>.  </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="WSChannelExtension" abstract="true" type="cppa:WSChannelExtensionType">
        <xs:annotation>
            <xs:documentation>An abstract WSChannel extension element</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="WSChannelExtensionType" abstract="true">
        <xs:annotation>
            <xs:documentation>An abstract WSChannel extension type</xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:ChannelExtensionType"> </xs:extension>
        </xs:complexContent>
    </xs:complexType>




    <xs:element name="SOAPVersion">
        <xs:annotation>
            <xs:documentation>
                <p>The version of SOAP to be used for messaging.</p>
                <p>In ebMS3, this corresponds to the <em>PMode[].Protocol.SOAPVersion</em> parameter</p>
                <p>If the element is not present in the containing <em>WSChannel</em> element 
                    (or element that inherits from this element), it MUST
                    be specified indirectly, via the definition of a <a href="#ChannelProfile">ChannelProfile</a>.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:token">
                <xs:enumeration value="1.1"/>
                <xs:enumeration value="1.2"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>


    <xs:element name="FaultHandling">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies the handling of faults.</p>
                <p>Note that there are no PMode parameters defined in ebMS3 to configure fault handling.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element minOccurs="0" ref="cppa:FaultChannelId"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="FaultChannelId" type="xs:IDREF">
        <xs:annotation>
            <xs:documentation>
                <p>This element is a cross-reference to the definition a of channel to be 
                    used to exchange SOAP Faults.</p>
                <p>If WS-Addressing is used, the <a href="#Endpoint">Endpoint</a> of the 
                    referenced channel MUST be used for the <em>wsa:FaultTo</em> header.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- Compression -->

    <xs:element name="Compression" substitutionGroup="cppa:ChannelFeature"
        type="cppa:CompressionType">
        <xs:annotation>
            <xs:documentation>
                <p>This element indicates that the message is compressed using message layer compression.  
                    For EDIINT, when using encryption, the entire message is compressed. 
                    For AS4, compression applies to the MIME parts in the SOAP-with-attachments envelope. 
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="CompressionType">
        <xs:annotation>
            <xs:documentation>The type of a <a href="#Compression">Compression</a> element.</xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:ChannelFeatureType">
                <xs:sequence>
                    <xs:element ref="cppa:CompressionAlgorithm" maxOccurs="unbounded"/>
                    <xs:element ref="cppa:CompressionDictionary" minOccurs="0" maxOccurs="unbounded"/>
                    
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="CompressionAlgorithm" type="cppa:non-empty-string">
        <xs:annotation>
            <xs:documentation>
                <p>This element configures the compression algorithm used. Its value identifies 
                    the compression algorithm or compressed data format that the sending MSH applies to ebmessage. </p>
                <ul>
                    <li>For the AS4 protocol, the only allowed value is <em>application/gzip</em>.</li>
                    <li>For the AS2 protocol, the only value is <em>application/pkcs7-mime</em> as
                        described in [RFC5402, RFC3851] which uses <em>ZLIB</em> compression [RFC1950].</li>
                </ul>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="CompressionDictionary" type="xs:anyURI">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies, using a URI, a compression dictionary that parties can agree to use. This
                    element MUST NOT be used in combination with compression algorithms that do not support the use 
                    of pre-agreed compression dictionaries.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- WS-Security -->



    <xs:element name="WSSecurityBinding" type="cppa:WSSecurityBindingType"
        substitutionGroup="cppa:ChannelFeature">
        <xs:annotation>
            <xs:documentation>
                <p>This element defines the use of WS-Security.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="WSSecurityBindingType">
        <xs:annotation>
            <xs:documentation>
                <p>If the <em>SecurityPolicy</em> element is present or referenced, 
                    it establishes the <em>default</em> security policy to
                be used, which can be overridden using the <a href="#Signature">Signature</a>, 
                    <a href="#Encryption">Encryption</a> or 
                    <a href="#UserAuthentication">UserAuthentication</a> elements.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:ChannelFeatureType">
                <xs:sequence>
                    <xs:element ref="cppa:WSSVersion" minOccurs="0"/>
                    <xs:element ref="cppa:SecurityPolicy" minOccurs="0"/>
                    <xs:element ref="cppa:SAMLToken" minOccurs="0"/>
                    <xs:element ref="cppa:Signature" minOccurs="0"/>
                    <xs:element ref="cppa:Encryption" minOccurs="0"/>
                    <xs:element ref="cppa:UserAuthentication" minOccurs="0"/>
                    <xs:any namespace="##other" processContents="lax" minOccurs="0"
                        maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attribute name="actorOrRole" type="xs:anyURI" use="optional">
                    <xs:annotation>
                        <xs:documentation>The optional <em>actorOrRole</em> attribute identifies 
                            the <em>actor</em> (SOAP 1.1) or <em>role</em> (SOAP 1.2) that the security header 
                            targets. Specific values MAY be associated with specific processing.
                            For example, the value
                            <em>http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/part2/200811/nextmsh</em>
                            indicates the use of the ebMS3 Part 2 multihop feature.
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="securityPolicy" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a <em>SecurityPolicy</em> defined elsewhere in 
                            the document. If present, there MUST NOT be a child <em>SecurityPolicy</em> 
                            element.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="WSSVersion">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies the version of WS-Security to be used. 
                    In ebMS3, this corresponds to the <em>PMode[1].Security.WSSVersion</em> parameter</p>
                <p>The value <em>1.1</em> also covers the <em>1.1.1</em> version, as that version is
                    a maintenance update that does not provide additional or different functionality.</p>
                <p>If the element is not present in the containing <a href="#WSSecurityBinding">WSSecurityBinding</a> element, it MUST
                    be specified indirectly, via the definition of a <a href="#ChannelProfile">ChannelProfile</a>.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:token">
                <xs:enumeration value="1.0"/>
                <xs:enumeration value="1.1"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>

    <xs:element name="SecurityPolicy" substitutionGroup="cppa:ChannelFeature"
        type="cppa:SecurityPolicyType">
        <xs:annotation>
            <xs:documentation>
                <p>This element can be used to associate a security policy with the message exchange. 
                    The policy may be embedded in the CPPA3 document, or it may be referenced.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="SecurityPolicyType">
        <xs:complexContent>
            <xs:extension base="cppa:ChannelFeatureType">
                <xs:sequence>
                    <xs:any minOccurs="0"/>
                </xs:sequence>
                <xs:attribute name="href" type="xs:anyURI" use="required">
                    <xs:annotation>
                        <xs:documentation>If the <em>href</em> attribute is present it MUST reference a 
                            WS-SecurityPolicy document stored outside the <a href="#CPP">CPP</a> 
                            or <a href="#CPA">CPA</a> and the element 
                            content MUST be empty.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Token References -->

    <xs:simpleType name="WSSSecurityTokenReferenceType">
        <xs:annotation>
            <xs:documentation>The WS-Security X.509 Token Profile distinguishes three type of mechanisms to 
                reference security token.  This type definition provides identifiers for these three values.
                XML Signature 1.1 deprecates <em>X509IssuerSerial</em> and suggests that instead 
                <em>X509Digest</em> be used. This value is provided for potential future use.                
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:token">
            <xs:enumeration value="SubjectKeyIdentifier"/>
            <xs:enumeration value="BinarySecurityToken"/>
            <xs:enumeration value="X509IssuerSerial"/>
            <xs:enumeration value="X509Digest"/>
        </xs:restriction>
    </xs:simpleType>

    <!-- Signature-->

    <xs:element name="Signature">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#Signature">Signature</a> element configures message signing. 
                    The CPPA3 <a href="#Signature">Signature</a> element is modelled after 
                    the W3C XML Signature structure [XMLDSIG-CORE, XMLDSIG-CORE1] but is also
                    used to configure EDIINT.
                </p>
                <p>In ebMS3, this type corresponds to the <em>PMode[1].Security.X509.*</em> parameters. </p>
                <p>In a <a href="#CPP">CPP</a>, <a href="#SignatureAlgorithm">SignatureAlgorithm</a>, 
                    <a href="#DigestAlgorithm">DigestAlgorithm</a> and 
                    <a href="#CanonicalizationMethod">CanonicalizationMethod</a> MAY occur more than once, 
                    expressing alternative options. 
                    In a <a href="#CPA">CPA</a>, they MUST occur at most once, expressing the agreed option. 
                </p>
                <p>For EDIINT protocols,  the <em>SignElements</em>, <em>SignAttachments</em>, 
                    <em>SignExternalPayloads</em> and <em>SAMLTokenRef</em>  elements MUST NOT be used.</p>
                <p>If the <a href="#SignatureAlgorithm">SignatureAlgorithm</a> and 
                    <a href="#DigestAlgorithm">DigestAlgorithm</a> elements are not present, they MUST
                    be specified indirectly, via the definition of a <a href="#ChannelProfile">ChannelProfile</a>.
                </p>
                <p>If one or more <a href="#SigningCertificatePolicySetRef">SigningCertificatePolicySetRef</a> elements
                    is present, Policy Certification Authority certificates and the issuing Certificate Authority 
                    certificate in the signing certificate chain MUST contain a <em>certificatePolicies</em> 
                    X.509 extension, the values of which MUST be within the set of referenced policies.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:SignatureFormat" minOccurs="0"/>
                <xs:element ref="cppa:SignatureAlgorithm" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:DigestAlgorithm" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:CanonicalizationMethod" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:SignatureTransformation" minOccurs="0"/>
                <xs:element ref="cppa:SigningCertificateRef" minOccurs="0"/>
                <xs:element ref="cppa:SigningCertificateRequired" minOccurs="0"/>
                <xs:element ref="cppa:SigningTrustAnchorSetRef" minOccurs="0"/>
                <xs:element ref="cppa:SigningCertificatePolicySetRef" minOccurs="0"
                    maxOccurs="unbounded"/>
                <xs:element ref="cppa:SigningCertificateRefType" minOccurs="0" maxOccurs="4"/>
                <xs:element ref="cppa:SAMLTokenRef" minOccurs="0"/>
                <xs:element ref="cppa:SignElements" minOccurs="0"/>
                <xs:element ref="cppa:SignAttachments" minOccurs="0"/>
                <xs:element ref="cppa:SignExternalPayloads" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="SignatureFormat">
        <xs:annotation>
            <xs:documentation>
                <xs:documentation>
                    <p>This element identifiers a format to be used for signatures. It MUST NOT be used in 
                        contexts where only a single signature format is used, or where it is not possible 
                        to select a
                        specific format, or where it is not common to specify the format.</p>
                    <p>For EDIINT, a common value is <em>pkcs7-signature</em>.</p>                    
                </xs:documentation>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="cppa:non-empty-string">
                    <xs:attribute name="version" type="cppa:non-empty-string">
                        <xs:annotation>
                            <xs:documentation>
                                <p>The version number of the signature format. </p>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>

    </xs:element>

    <xs:element name="SignatureAlgorithm" type="cppa:AlgorithmType">
        <xs:annotation>
            <xs:documentation>
                <p>This element defines the signature algorithm to be used for generating and validating the
                    signature. </p>
                <p>In ebMS3, this corresponds to the 
                    <em>PMode[1].Security.X509.Signature.Algorithm</em> parameter.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="DigestAlgorithm" type="cppa:AlgorithmType">
        <xs:annotation>
            <xs:documentation>
                <p>DigestAlgorithm is a REQUIRED element that identifies the digest algorithm to be 
                    applied to the signed object.</p>
                <p>In ebMS3, this corresponds to the 
                    <em>PMode[1].Security.X509.Signature.HashFunction</em> parameter. 
                </p>
                <p>AS2 (RFC 4130) can use the values MD5 (defined in [RFC6931] as 
                    <em>http://www.w3.org/2001/04/xmldsig-more#md5</em>) or SHA-1 (defined in 
                    [XMLDSIG-CORE] as <em>http://www.w3.org/2000/09/xmldsig#sha1</em>.
                    AS2 implementations also implement more recent algorithms. 
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="CanonicalizationMethod" type="xs:anyURI">
        <xs:annotation>
            <xs:documentation>
                <p>The Canonicalization method to be applied in the creation of the signature.</p>
                <p>This element does not correspond to any ebMS3 PMode parameter.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="SignatureTransformation" type="xs:anyURI">
        <xs:annotation>
            <xs:documentation>
                <p>The Signature Transformation method to be applied in the creation of the signature.</p>
                <p>This element does not correspond to any ebMS3 PMode parameter.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="SigningCertificateRef" type="cppa:CertificateRefType"
        substitutionGroup="cppa:CertificateRef">
        <xs:annotation>
            <xs:documentation>
                <p>A reference to the leaf certificate that is to be used to sign the data.</p>
                <p>In ebMS3, this corresponds to the 
                    <em>PMode[1].Security.X509.Signature.Certificate</em> parameter.</p>
                <p>Requirements on presence or absence of this element in a CPP or CPA and use in CPA formation 
                    can be configured using 
                    the <a href="#SigningCertificateRequired">SigningCertificateRequired</a> element.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="SigningCertificateRequired" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>In a CPP, this element can be used in a <a href="#NamedChannel">NamedChannel</a> or <a href="#Signature">Signature</a> element by a receiving party to indicate whether a leaf 
                    signing certificate is to be provided by the sending (i.e. signing) party in the 
                    corresponding element in its CPP. If present with a true value in a CPP context for a 
                    receiver channel, a valid <a href="#SigningCertificateRef">SigningCertificateRef</a> element 
                    MUST be present in the CPP of the sending party for the channel. This referenced 
                    certificate MUST be included for specified signed CPA channel in a CPA derived from these
                    CPPs for the channel.
                </p>
                <p>This element MUST NOT be used in a CPA. If specified in a CPP for the 
                    sending (signing) party  for the channel, its value is ignored in unification.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="SigningCertificateRefType" type="cppa:WSSSecurityTokenReferenceType">
        <xs:annotation>
            <xs:documentation>
                <p>Specifies how the signing certificate is referenced in the WS-Security header</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>


    <xs:element name="SignElements">
        <xs:annotation>
            <xs:documentation>
                <p>This elements specifies, as a sequence of <a href="#Expression">Expression</a> elements, the elements in the message that
                    MUST be signed. </p>
                <p>This element MUST NOT be present in a <em>SignatureType</em> content that is not SOAP or another 
                    XML-based message format. Furthermore,  it MUST NOT be present in protocols or profiles that do
                    not support configuration of elements that are to be signed. This is the case with AS4, which always 
                    signs a known set of SOAP parts, if the message is signed.
                </p>
                <p>In ebMS3, this corresponds to the 
                    <em>PMode[1].Security.X509.Sign.Element</em> parameter.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:Expression" minOccurs="1" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="SignAttachments" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>This Boolean-valued element specifies if attachments are to be signed.</p>
                <p>This element MUST NOT be present in message formats that do not support attachments or 
                    signing of attachments. Furthermore,  it MUST NOT be present in protocols or profiles that do not 
                    support configuration of attachment signing. This is the case with AS4, which always signs all 
                    attachments if the message is signed.
                </p>
                <p>In ebMS3, this corresponds to the <em>PMode[1].Security.X509.Sign.Attachment</em> parameter.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="SignExternalPayloads" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies if external payloads are to be signed.</p>
                <p>This element MUST NOT be present in message formats that do not support external payloads or 
                    signing of external payloads.                    
                </p>
                <p>There is no corresponding ebMS3 PMode parameter for this element.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="SigningTrustAnchorSetRef" type="cppa:CertificateRefType">
        <xs:annotation>
            <xs:documentation>
                <p>A reference to a trust anchor that a signing certificate MUST chain to.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="SigningCertificatePolicySetRef" type="cppa:CertificatePolicySetReferenceType">
        <xs:annotation>
            <xs:documentation>A reference to an X.509 certificate policy set to be used for a 
                signing certificate.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="Encryption">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#Encryption">Encryption</a> element configures message encryption. 
                    The CPPA3 <a href="#Encryption">Encryption</a> element is modelled after the
                    W3C XML Encryption [XMLENC-CORE, XMLENC-CORE1] structure but is also
                    used to configure encryption for channels that do not use XML Encryption.
                </p>
                <p>In ebMS3, this structure corresponds to the <em>PMode[1].Security.X509.Encryption.*</em> parameters.</p>
                <p>If one or more <a href="#EncryptionCertificatePolicySetRef">EncryptionCertificatePolicySetRef</a> elements
                    is present, Policy Certification Authority certificates and the issuing Certificate Authority 
                    certificate in the encryption certificate chain MUST contain a <em>certificatePolicies</em> 
                    X.509 extension, the values of which MUST be within the set of referenced policies.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:annotation>
                <xs:documentation>
                </xs:documentation>
            </xs:annotation>
            <xs:sequence>
                <xs:element ref="cppa:EncryptionFormat" minOccurs="0"/>
                <xs:element ref="cppa:KeyEncryption" minOccurs="0"/>
                <xs:element ref="cppa:EncryptionAlgorithm" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:EncryptElements" minOccurs="0"/>
                <xs:element ref="cppa:EncryptAttachments" minOccurs="0"/>
                <xs:element ref="cppa:EncryptExternalPayloads" minOccurs="0"/>
                <xs:element ref="cppa:EncryptionCertificateRef" minOccurs="0"/>
                <xs:element ref="cppa:EncryptionCertificateRequired" minOccurs="0"/>
                <xs:element ref="cppa:EncryptionTrustAnchorSetRef" minOccurs="0"/>
                <xs:element ref="cppa:EncryptionCertificatePolicySetRef" minOccurs="0"
                    maxOccurs="unbounded"/>
                <xs:element ref="cppa:EncryptionCertificateRefType" minOccurs="0" maxOccurs="4"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="KeyEncryption">
        <xs:annotation>
            <xs:documentation>
                <p>The <em>KeyTransport</em> element supports the configuration of encryption key transport. 
                    It is designed to configure use of
                    <a href="http://www.w3.org/TR/2013/REC-xmlenc-core1-20130411/#sec-Alg-KeyTransport">XML 
                        Encryption Key Transport</a> and similar protocols.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:EncryptionAlgorithm" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:MaskGenerationFunction" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:DigestAlgorithm" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>

    </xs:element>

    <xs:element name="MaskGenerationFunction" type="cppa:AlgorithmType">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies the use of a mask generation function.</p>
                <p>The value is an identifier of a mask generation function like 
                    <a href="http://www.w3.org/2009/xmlenc11#mgf1sha256">http://www.w3.org/2009/xmlenc11#mgf1sha256</a>.</p>
                <p>When using XML encryption, it specifies the value of 
                    <em>xenc:EncryptedKey / xenc:EncryptionMethod / xenc11:MGF</em>.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="EncryptionFormat">
        <xs:annotation>
            <xs:documentation>
                <p>The element MUST NOT be used with protocols that have a fixed data format for
                    encrypted content, such as WS-Security. </p>
                <p>This element corresponds to the CPPA2 <em>DigitalEnvelope</em> element. When used
                    with ebMS2, it can be used to select the digital envelope format to be used 
                    with the use of that protocol. 
                    The use of S/MIME is selected the value <em>S/MIME</em>.
                    For S/MIME, the current version in 3.2, defined in [RFC5751]. Other versions MAY be
                    selected using the <em>version</em> attribute.
                    XML Encryption is selected used the value <em>http://www.w3.org/2001/04/xmlenc#</em>.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="cppa:non-empty-string">
                    <xs:attribute name="version" type="cppa:non-empty-string">
                        <xs:annotation>
                            <xs:documentation>
                                <p>The version number of the encryption format. </p>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="EncryptionAlgorithm" type="cppa:AlgorithmType">
        <xs:annotation>
            <xs:documentation>
                <p>This element can be used to specify the key transport algorithm and the data encryption
                    algorithm.</p>
                <p>Key Transport algorithms are public key encryption algorithms especially specified 
                    for encrypting and decrypting keys.  
                    When using XML Encryption the value of this element can be used as value in <em>KeyEncryption</em> 
                    to determine 
                    <em>xenc:EncryptedKey / xenc:EncryptionMethod / @Algorithm</em>. The
                    value is an identifier of an encryption algorithm 
                    like <a href="http://www.w3.org/2009/xmlenc11#rsa-oaep">http://www.w3.org/2009/xmlenc11#rsa-oaep</a>.
                </p>
                <p>In ebMS3, see <a href="https://issues.oasis-open.org/browse/EBXMLMSG-45">https://issues.oasis-open.org/browse/EBXMLMSG-45</a>.</p>
                
                <p>
                    When using XML Encryption, the <a href="#EncryptionAlgorithm">EncryptionAlgorithm</a> element 
                    can also be used
                    in <a href="#DataEncryption">DataEncryption</a> to set the value 
                    of the <em>xenc:EncryptedData / xenc:EncryptionMethod / @Algorithm</em> attribute. 
                    The value is an identifier like <a href="http://www.w3.org/2009/xmlenc11#aes128-gcm">http://www.w3.org/2009/xmlenc11#aes128-gcm</a>
                </p>
                <p>In ebMS3, this corresponds to the 
                    <em>PMode[1].Security.X509.Encryption.Algorithm</em> parameter.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="EncryptElements">
        <xs:annotation>
            <xs:documentation>
                <p>This element expresses elements that MUST be encrypted.</p>
                <p>This element MUST NOT be present in a <a href="#DataEncryption">DataEncryption</a> 
                    element that is not SOAP or another 
                    XML-based message format. Furthermore,  it MUST NOT be present in protocols or profiles that do
                    not support configuration of elements that are to be signed. This is the case with AS4, which always 
                    signs a known set of SOAP parts if the message is signed.
                </p>
                <p>In ebMS3, this corresponds to the 
                    <em>PMode[1].Security.X509.Encrypt.Element</em> parameter.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:Expression" minOccurs="1" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="EncryptAttachments" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>The element expresses whether or not attachments are encrypted.</p>
                <p>This element MUST NOT be present in message formats that do not support 
                    attachments or encryption of attachments.
                    Furthermore,  it MUST NOT be present in protocols or profiles that do not support 
                    configuration of attachment 
                    encryption. This is the case with AS4, which always signs all attachments if 
                    the message is signed.
                </p>
                <p>In ebMS3, this corresponds to the 
                    <em>PMode[1].Security.X509.Encrypt.Attachment</em> parameter.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="EncryptExternalPayloads" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>The element expresses whether or not external payloads are encrypted.</p>
                <p>This element MUST NOT be present in message formats that do not support 
                    external payloads or encryption of attachments.
                    Furthermore,  it MUST NOT be present in protocols or profiles that do not support 
                    configuration of external payload encryption. This is the case with AS4, 
                    which always encrypts all attachments if the message is signed.
                </p>
                <p>There is no corresponding PMode parameter for this element.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="AlgorithmType">
        <xs:annotation>
            <xs:documentation>
                <p>For signing and encryption algorithms, the value of an element of type <em>AlgorithmType</em> 
                    MUST be an algorithm identifier defined in XML Signature [XMLDSIGCORE, XMLDSIGCORE1], 
                    XML Encryption [XMLENC-CORE, XMLENC-CORE1] or in RFC 6931. 
                </p>
                <p>Note that these algorithm identifier URIs specify the key size, e.g. 
                    <em>http://www.w3.org/2009/xmlenc11#aes128-gcm</em> and 
                    <em>http://www.w3.org/2009/xmlenc11#aes256-gcm</em> specify 128 and 256 bit sizes, respectively.
                    Therefore this element also covers the CPPA2 <em>minimumStrength</em> attribute and the ebMS3 
                    <em>PMode[1].Security.X509.Encryption.MinimumStrength</em> P-Mode parameter. 
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:simpleContent>
            <xs:extension base="xs:anyURI">
                <xs:attribute name="version" use="optional">
                    <xs:annotation>
                        <xs:documentation>An optional version indicator of the algorithm</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>


    <xs:element name="EncryptionCertificateRef" type="cppa:CertificateRefType"
        substitutionGroup="cppa:CertificateRef">
        <xs:annotation>
            <xs:documentation>
                <p>This element references a leaf certificate that is to be used for encryption.</p>
                <p>With ebMS3, this element corresponds with the 
                    <em>PMode[1].Security.X509.Encryption.Certificate</em> parameter.</p>
                <p>Requirements on presence or absence of this element in a CPP or CPA and use in CPA formation 
                    can be configured using 
                    the <a href="#EncryptionCertificateRequired">EncryptionCertificateRequired</a> element.
                </p>
                
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="EncryptionCertificateRequired" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>In a CPP, this element can be used in a <a href="#NamedChannel">NamedChannel</a> or <a href="#Encryption">Encryption</a> element by a sending party to indicate whether a leaf 
                    encryption certificate is to be provided by the receiving (i.e. decrypting) party in the 
                    corresponding element in its CPP. If present with a true value in a CPP context for a 
                    receiver channel, or if the element is absent, 
                    a valid <a href="#EncryptionCertificateRef">EncryptionCertificateRef</a> element 
                    MUST be present in the CPP of the receiving party for the channel. This referenced 
                    certificate MUST be included for specified encrypted CPA channel in a CPA derived 
                    from these CPPs  for the channel.
                </p>
                <p>This element MUST NOT be used in a CPA. If specified in a CPP for the 
                    receiving (decrypting) party  for the channel, its value is ignored in unification.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="EncryptionCertificateRefType" type="cppa:WSSSecurityTokenReferenceType">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies how the encryption certificate is referenced in the WS-Security header</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="EncryptionTrustAnchorSetRef" type="cppa:CertificateRefType">
        <xs:annotation>
            <xs:documentation>
                <p>A reference to a trust anchor set that an encryption certificate MUST chain to.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="EncryptionCertificatePolicySetRef"
        type="cppa:CertificatePolicySetReferenceType">
        <xs:annotation>
            <xs:documentation>A reference to an X.509 certificate policy set to be used for an 
                encryption certificate.</xs:documentation>
        </xs:annotation>
    </xs:element>


    <!-- Security Assertion Markup Language (SAML)  -->

    <xs:element name="SAMLToken" abstract="true" type="cppa:SAMLTokenType"
        substitutionGroup="cppa:SecurityToken">
        <xs:annotation>
            <xs:documentation>
                <p>This element is an abstract Security Assertion Markup Language (SAML) 
                    configuration element that controls the presence and processing 
                    of a SAML token in the WS-Security header.  
                    Details on use of SAML are to be provided by substitution elements.  
                    Support for the Security Assertion Markup Language (SAML) is in this version of 
                    CPPA limited to providing support for the ebMS3 SAML conformance clause
                    [ebMS-saml-conformance].
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="SAMLTokenType" abstract="true">
        <xs:annotation>
            <xs:documentation>An abstract SAML Token Type.</xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:SecurityTokenType"/>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="SAMLTokenRef" substitutionGroup="cppa:SecurityTokenRef"
        type="cppa:SAMLTokenRefType">
        <xs:annotation>
            <xs:documentation>
                <p>A reference to a SAML token.</p>
            </xs:documentation>
        </xs:annotation>

    </xs:element>

    <xs:complexType name="SAMLTokenRefType">
        <xs:complexContent>
            <xs:extension base="cppa:SecurityTokenRefType">
                <xs:attribute name="tokenId" type="xs:IDREF" use="required">
                    <xs:annotation>
                        <xs:documentation>A IDREF type reference to a SAML token</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="SAMLKeyConfirmedSubjectToken" substitutionGroup="cppa:SAMLToken">
        <xs:annotation>
            <xs:documentation>
                <p>When used with ebMS3, this element defines support for the ebMS3 SAML conformance 
                    clause [ebMS-saml-conformance], which provides ebMS3 with an alternative way of obtaining and 
                    referencing a signing key. The SAML conformance clause is based on use of 
                    signed holder-of-key subject 
                    confirmations using either symmetric or asymmetric keys and to obtain attributes. 
                    The ebMS3 SAML
                    conformance clause is designed to obviate the need for agreements such as <a href="#CPA">CPA</a> 
                    and of <a href="#CPA">CPA</a> formation. Parties MAY use 
                    partner <a href="#CPP">CPP</a> s directly to dynamically 
                    configure ebMS3 messaging.
                    This element and its sub-elements correspond to 
                    the a superset of <em>PMode[1].Security.SAML</em> parameters defined in 
                    the ebMS3 SAML Conformance clause.  
                </p>
                <p>The mandatory <a href="#IDPRegistrationSetRef">IDPRegistrationSetRef</a> element 
                    references a set of identity
                    service providers that the party MUST register with.  It corresponds to the 
                    <em>PMode[1].Security.SAML.RegisteredIdPs</em> parameter and can be used in both 
                    CPPs and CPAs.
                </p>
                <p>In <a href="#CPA">CPA</a> formation, it MUST be verified that the intersection of IDP sets of
                    Sender and Receiver is non-empty, as both Sender and Receiver MUST register 
                    with the same IDP. This IDP authenticates Sender and (if symmetric proof keys 
                    are used) encrypts the proof key for Receiver. The first matching shared IDP 
                    MAY be referenced in the formed <a href="#CPA">CPA</a> using the <a href="#ProviderID">ProviderID</a> element.  
                    However, this is only a hint as the Sender MAY use any shared IDP acceptable to
                    Receiver. The <a href="#ProviderID">ProviderID</a> element MUST NOT be used 
                    in a <a href="#CPP">CPP</a>.
                </p>
                <p>Optionally, Sender MAY reference a particular signing certificate for 
                    use as asymmetric proof key using the <a href="#SigningCertificateRef">SigningCertificateRef</a> element. 
                    This reference MAY be used by Sender to select the 
                    assymmetric key to include in the WS-Trust (or equivalent) request to the secure 
                    token service.  Note that the purpose of the SAML conformance clause 
                    is to obviate the need for certificate exchange, so Receiver is NOT REQUIRED 
                    to validate this on incoming messages.  
                    This is a feature in CPPA3 that does not correspond
                    to a parameter in the ebMS3 SAML conformance clause P-Mode.
                    The <a href="#SigningCertificateRef">SigningCertificateRef</a> element 
                    MUST NOT be present when symmetric proof 
                    keys are used.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:SAMLTokenType">
                    <xs:sequence>
                        <xs:element ref="cppa:SAMLVersion"/>
                        <xs:element ref="cppa:IDPRegistrationSetRef"/>
                        <xs:element ref="cppa:ProviderID" minOccurs="0"/>
                        <xs:element ref="cppa:SigningCertificateRef" minOccurs="0"/>
                        <xs:element ref="cppa:SAMLAttribute" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="cppa:KeyType"/>
                    </xs:sequence>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="SAMLVersion">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies the version of SAML that MUST be used for SAML Authentication.</p>
                <p>In the ebMS3 SAML Conformance Clause, this corresponds to the 
                    <em>PMode[].Security.SAML.Version</em> parameter.</p>
                <p>The values correspond to 
                    <em>/sp:SamlToken/wsp:Policy/sp:WssSamlV11Token11</em>
                    and <em>/sp:SamlToken/wsp:Policy/sp:WssSamlV20Token</em>
                    in WS-SecurityPolicy [WSSecurityPolicy13].</p>                
            </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:token">
                <xs:enumeration value="1.1"/>
                <xs:enumeration value="2.0"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>

    <xs:element name="KeyType">
        <xs:annotation>
            <xs:documentation>
                <p>The element specifies the type of the SAML proof key. The ebMS3 SAML Conformance Clause
                    supports symmetric and asymmetric key types. </p>
            </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:token">
                <xs:enumeration value="symmetric"/>
                <xs:enumeration value="asymmetric"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>

    <xs:element name="SAMLAttribute" type="cppa:SAMLAttributeType">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies the use of a SAML Attribute assertion in a SAML token.</p>
                <p>This element, which can occur multiple times in the <em>SAMLKeyConfirmedSubject</em> 
                    element, corresponds to the 
                    <em>PMode[1].Security.SAML.MandatoryAttributes</em>
                    <em>PMode[1].Security.SAML.OptionalAttributes</em> parameters. Whether an 
                    attribute is mandatory or optional is specified using the mandatory <em>use</em> attribute.
                </p>
                <p>When used in a WS-Security header used to secure an ebMS3 PullRequest and targeted to
                    the <em>ebms</em> role, occurrences of this element correspond to the 
                    <em>PMode[1].Initiator.Authorization.SAML.AttributesAndValues</em> parameter. 
                    In that case, the required values MUST be specified as content of the 
                    <em>AttributeValue</em> child element.
                </p>
                <p>Apart from the <em>use</em> attribute, the definition of <em>SAMLAttribute</em> 
                    copies the element and attribute content definitions of the SAML 2.0 Core schema.
                </p>
                <p>The set of mandatory attributes corresponds to <em>/sp:SamlToken/wst:Claims</em> 
                    in WS-SecurityPolicy [WSSecurityPolicy13].</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>
    <xs:complexType name="SAMLAttributeType">
        <xs:sequence>
            <xs:element ref="cppa:AttributeValue" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="use" type="cppa:usetype" use="required">
            <xs:annotation>
                <xs:documentation>If <em>true</em>, the attribute is a
                    <em>PMode[1].Security.SAML.MandatoryAttributes</em> attribute. 
                    If <em>false</em>, it is a <em>PMode[1].Security.SAML.OptionalAttributes</em>
                    attribute.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="Name" type="xs:string" use="required"/>
        <xs:attribute name="NameFormat" type="xs:anyURI" use="optional"/>
        <xs:attribute name="FriendlyName" type="xs:string" use="optional"/>
        <xs:anyAttribute namespace="##other" processContents="lax"/>
    </xs:complexType>

    <xs:element name="AttributeValue" type="xs:anyType" nillable="true"/>

    <!-- Username based authentication -->

    <xs:element name="UserAuthentication" type="cppa:UserAuthenticationType">
        <xs:annotation>
            <xs:documentation>
                <p>This element configures user authentication. It can configure 
                    UsernameToken security in WS-Security or HTTP Authentication.</p>
                <p>When used with ebMS3 for WS-Security, this element covers the 
                    <em>PMode[1].Security.UsernameToken.username</em>
                    <em>PMode[1].Security.UsernameToken.password</em>
                    <em>PMode[1].Security.UsernameToken.Digest</em>
                    <em>PMode[1].Security.UsernameToken.Nonce</em> and
                    <em>PMode[1].Security.UsernameToken.Created</em> parameters,  when applied to the regular
                    WS-Security header.
                </p>
                <p>When used with ebMS3, this element also covers the combination of 
                    <em>PMode[1].Security.PModeAuthorize</em> 
                    and <em>PMode.{Initiator/Responder).Authorization.*</em> parameters that apply to the WS-Security
                    header that is used for message authorization.
                </p>
                <p>When used with the HTTP protocol,  this element configures 
                    HTTP Authentication.</p>
                <p>The <em>Username</em> and <em>Password</em> elements MUST NOT be set in a <a href="#CPP">CPP</a> but 
                    MUST be set in a <a href="#CPA">CPA</a>.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="UserAuthenticationType">
        <xs:annotation>
            <xs:documentation>
                <p>Type Definition for User Authentication.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="cppa:Username" minOccurs="0"/>
            <xs:element ref="cppa:Password" minOccurs="0"/>
            <xs:element ref="cppa:Digest" minOccurs="0"/>
            <xs:element ref="cppa:Nonce" minOccurs="0"/>
            <xs:element ref="cppa:Created" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>


    <xs:element name="Username" type="cppa:non-empty-string">
        <xs:annotation>
            <xs:documentation>
                <p>A <em>Username</em> that MUST be used with <em>UserAuthentication</em>.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="Password" type="cppa:non-empty-string">
        <xs:annotation>
            <xs:documentation>
                <p>A <em>Password</em> that MUST be used with <em>UserAuthentication</em>.  
                    In <a href="#CPA">CPA</a> formation, the 
                    value of this element MUST be set to a sufficiently strong and unpredictable value.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="Digest" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>This element expresses whether the <em>UserAuthentication</em> uses Digest Authentication.
                    The algorithm used for digest generation depends on the context in which
                    <em>UserAuthentication</em> is used.  In HTTP, it is MD5 and in WS-Security,
                    it is SHA1.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="Nonce" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>This element expresses whether a <em>Nonce</em> MUST or MUST NOT be included with 
                    a <em>UserAuthentication</em>.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="Created" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>Expresses whether a <em>Created</em> MUST or MUST NOT be included 
                    with a <em>UserAuthentication</em>.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- Reliable Messaging -->

    <xs:element name="ReliableMessagingBinding" type="cppa:ReliableMessagingBindingType"
        abstract="true" substitutionGroup="cppa:ChannelFeature">
        <xs:annotation>
            <xs:documentation>
                <p>The abstract element <a href="#ReliableMessagingBinding">ReliableMessagingBinding</a> specifies a binding of a 
                    channel to a reliable messaging protocol.
                </p>
                <p>This element is a channel feature, so its instances can be reused by reference in multiple
                    channel definitions. </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ReliableMessagingBindingType" abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>
                    The <em>ReliableMessagingBindingType</em> type is defined as an abstract type
                    with no elements or attributes.  It is an abstract type that can be specialized,
                    in extensions of this schema, 
                    for reliable messaging protocols such as WS-ReliableMessaging and WS-Reliability. 
                    This schema includes support for AS4, and then configures duplicate handling,
                    persistence and retransmission handling for AS4 messages.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:ChannelFeatureType">
                <xs:sequence>
                    <xs:element ref="cppa:DuplicateHandling" minOccurs="0"/>
                    <xs:element ref="cppa:RetryHandlingBase" minOccurs="0"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="DuplicateHandling">
        <xs:annotation>
            <xs:documentation>
                <p>The <em>DuplicateHandling</em> element specifies a feature used by various reliable 
                    messaging protocols. It specifies how received duplicates are to be 
                    detected and/or processed.
                </p>
                <p>The type definition provides common parameters for duplicate handling.
                    The logic for determining whether a message is a duplicate depends on 
                    the messaging protocol. 
                    Any <em>##other</em> content may convey additional configuration parameters 
                    for duplicate handling. 
                </p>
                <p>When used with <em>WSReliableMessagingBinding</em>, this element corresponds to the 
                    <em>PMode[1].Reliability.AtMostOnce.Contract</em> parameter.
                </p>
                <p>When used with AS4 reception awareness, this element corresponds to
                    <em>PMode[1].ReceptionAwareness.DuplicateDetection</em>
                    <em>PMode[1].ReceptionAwareness.DetectDuplicates.Parameters</em>
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:DuplicateElimination"/>
                <xs:element ref="cppa:PersistDuration" minOccurs="0"/>
                <xs:any namespace="##other" processContents="lax" minOccurs="0"
                    maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>


    <xs:element name="DuplicateElimination" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>The <em>DuplicateElimination</em> element specifies if a receiving MSH MUST
                    eliminate any received duplicates, if detected, thus implementing <em>at most once</em> 
                    delivery assurance. 
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="PersistDuration" type="xs:duration">
        <xs:annotation>
            <xs:documentation>
                <p>The value of the PersistDuration element is the minimum length of time, 
                    expressed as an XML
                    Schema duration, that data from a message that is sent reliably is kept in
                    Persistent Storage by message service implementation that receives that message to
                    facilitate the elimination of duplicates. </p>
            </xs:documentation>
        </xs:annotation>

    </xs:element>

    <xs:element name="RetryHandlingBase" abstract="true" type="cppa:RetryHandlingBaseType">
        <xs:annotation>
            <xs:documentation>
                <p>The <em>RetryHandlingBase</em> element specifies the handling of retransmission of 
                    messages until successful processing of the message by the recipient 
                    is confirmed, the number of retransmissions is exhausted or an unrecovereable 
                    error occurs. This mechanism supports <em>at least once</em> delivery assurance. 
                    This element is an abstract element, to support extensibility to other 
                    features for handling retries. 
                </p>
                <p>When used with AS4 reception awareness, this element corresponds to the
                    <em>PMode[1].ReceptionAwareness.Retry</em>
                    <em>PMode[1].ReceptionAwareness.Retry.Parameters</em>
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="RetryHandlingBaseType" abstract="true"/>

    <xs:element name="RetryHandling" substitutionGroup="cppa:RetryHandlingBase">
        <xs:annotation>
            <xs:documentation>
                <p>This element defines a basic set of configuration elements.</p>
                <p>If <em>ExponentialBackoff</em> is present, the element <em>RetryInterval</em> MUST occur 
                    at most once. </p>
                <p>If <em>ExponentialBackoff</em> is not present, <em>retryvalue</em> is the 
                    value of <em>Retries</em> element, and <em>retryintervalcount</em> is 
                    the number of 
                    occurrences of the element <em>RetryInterval</em>, then <em>retryintervalcount</em> MUST 
                    NOT exceed <em>retryvalue</em>.  If <em>retryintervalcount</em> is less than <em>retryvalue</em>,
                    this is equivalant to up to <em>retryvalue</em> additional <em>RetryInterval</em> 
                    elements being present, 
                    with the same value as the last specified value for <em>RetryInterval</em>.
                </p>
                <p>Any randomized adjustment of the timing of retransmissions (for example, to smooth out 
                    congestions) is implementation-dependent and not explicitly configured. 
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:RetryHandlingBaseType">
                    <xs:sequence>
                        <xs:element ref="cppa:Retries"/>
                        <xs:element ref="cppa:ExponentialBackoff" minOccurs="0"/>
                        <xs:element ref="cppa:RetryInterval" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="Retries" type="xs:integer">
        <xs:annotation>
            <xs:documentation>The maximum number of retries.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="RetryInterval" type="xs:duration">
        <xs:annotation>
            <xs:documentation>
                <p>The duration between a transmission attempt and the next one. </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ExponentialBackoff">
        <xs:annotation>
            <xs:documentation>
                <p>Presence of this element specifies that the <em>RetryInterval</em> MUST be 
                adjusted according to the exponential backoff algorithm.</p>
                <p>The value of <em>Ceiling</em> MUST be less than <em>Retries</em>.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:annotation>
                <xs:documentation>
                </xs:documentation>
            </xs:annotation>
            <xs:sequence>
                <xs:element ref="cppa:Ceiling" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>


    <xs:element name="Ceiling" type="xs:duration">
        <xs:annotation>
            <xs:documentation>
                <p>The maximum length of a retry interval. Once the retry interval has been incremented to a 
                    value equal to or higher than the ceiling, further increments MUST NOT be applied.</p>
            </xs:documentation>
        </xs:annotation>

    </xs:element>

    <!-- ebMS2 -->

    <xs:element name="ebMS2Channel" type="cppa:ebMS2ChannelType" substitutionGroup="cppa:Channel">
        <xs:annotation>
            <xs:documentation>
                <p>This element configures a channel using the ebXML Messaging version 2.0 protocol [ebMS2].</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ebMS2ChannelType">
        <xs:annotation>
            <xs:documentation>
                <p>The ebMS2 Channel Type is a subtype of the Channel Type.</p>
                <p>A <a href="#Channel">Channel</a> that is an 
                    <a href="#ebMS2Channel">ebMS2Channel</a> MUST NOT be linked 
                    to a <a href="#Transport">Transport</a> element:
                    <ol>
                        <li>In case of a <em>Sync</em> transport channel binding for the response in a Two Way 
                            exchange, which is indicated by the <em>asResponse</em> attribute being present
                            with a true value, and the channel being used by an <a href="#ActionBinding">ActionBinding</a> that 
                            has a <em>replyTo</em> attribute linking the action to a request actions. That 
                            request action then MUST be bound to a channel to provides a backchannel for 
                            the synchronous response. 
                        </li>
                        <li>In case of a synchronous standalone ebMS2 error or receipt signal, also 
                            indicated by the <em>asResponse</em> attribute being present with a 
                            true value.</li>
                    </ol>
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:ChannelType">
                <xs:sequence>
                    <xs:element ref="cppa:ErrorHandling" minOccurs="0"/>
                    <xs:element ref="cppa:ReceiptHandling" minOccurs="0"/>
                    <xs:element ref="cppa:ebMS2ReliableMessaging" minOccurs="0"/>
                    <xs:element ref="cppa:ebMS2SecurityBinding" minOccurs="0"/>
                    <xs:element ref="cppa:ebMS2ChannelExtension" minOccurs="0" maxOccurs="unbounded"
                    />
                </xs:sequence>
                <xs:attribute name="securityBinding" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#ebMS2SecurityBinding">ebMS2SecurityBinding</a> element. If 
                            this attribute is present, there MUST NOT be a 
                            child <a href="#ebMS2SecurityBinding">ebMS2SecurityBinding</a>.  </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="errorHandling" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#ErrorHandling">ErrorHandling</a> element. If 
                            this attribute is present, there MUST NOT be a 
                            child <a href="#ErrorHandling">ErrorHandling</a> element.  </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="receiptHandling" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#ReceiptHandling">ReceiptHandling</a> element. If 
                            this attribute is present, there MUST NOT be a 
                            child <a href="#ReceiptHandling">ReceiptHandling</a> element.  </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="ebMS2ReliableMessaging" substitutionGroup="cppa:ReliableMessagingBinding">
        <xs:annotation>
            <xs:documentation>
                <p>Presence of this element specifies the use of the ebMS version 2.0 Reliable Messaging 
                    protocol [ebMS2] for messages exchanged using this channel. </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:ReliableMessagingBindingType">
                    <xs:sequence> </xs:sequence>
                    <xs:attribute name="actor" type="cppa:ebMS2ActorType" use="optional">
                        <xs:annotation>
                            <xs:documentation>
                                <p>The <em>actor</em> attribute specifies the target of the 
                                    ebMS2 <em>AckRequested</em> element.</p>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                    <xs:attribute name="ordered" type="xs:boolean">
                        <xs:annotation>
                            <xs:documentation>
                                <p>This attribute specifies if the ebMS2 <em>MessageOrder</em> module 
                                    is to be used.</p>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>


    <xs:simpleType name="ebMS2ActorType">
        <xs:annotation>
            <xs:documentation>The type of ebMS2 actor.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:anyURI">
            <xs:enumeration value="urn:oasis:names:tc:ebxml-msg:actor:nextMSH"/>
            <xs:enumeration value="urn:oasis:names:tc:ebxml-msg:actor:toPartyMSH"/>
        </xs:restriction>
    </xs:simpleType>


    <xs:element name="ebMS2SecurityBinding" substitutionGroup="cppa:ChannelFeature"
        type="cppa:ebMS2SecurityBindingType">
        <xs:annotation>
            <xs:documentation>
                <p>Specifies the use of the ebMS2 security module.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ebMS2SecurityBindingType">
        <xs:complexContent>
            <xs:extension base="cppa:ChannelFeatureType">
                <xs:sequence>
                    <xs:element ref="cppa:Signature" minOccurs="0"/>
                    <xs:element ref="cppa:Encryption" minOccurs="0"/>
                    <xs:any namespace="##other" processContents="lax" minOccurs="0"
                        maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="ebMS2ChannelExtension" abstract="true" type="cppa:ebMS2ChannelExtensionType">
        <xs:annotation>
            <xs:documentation>An abstract ebMS2Channel extension element</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ebMS2ChannelExtensionType" abstract="true">
        <xs:annotation>
            <xs:documentation>An abstract ebMS2Channel Extension type</xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:ChannelExtensionType"> </xs:extension>
        </xs:complexContent>
    </xs:complexType>




    <!-- ebMS3 -->

    <xs:element name="ebMS3Channel" type="cppa:ebMS3ChannelType" substitutionGroup="cppa:Channel">
        <xs:annotation>
            <xs:documentation>
                <p>This element configures a channel using the ebMS3 messaging protocol 
                    [EBMS3CORE,EBMS3PART2, AS4-Profile, ebMS-saml-conformance]. 
                    Both user messages and
                    signal messages use ebMS3 channels. When bound to HTTP or another protocol that
                    supports bidirectional communication, an ebMS3 channel MAY either use the forward 
                    channel (from the initiator to the responder) or the backchannel (which flows in 
                    the reverse direction). 
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ebMS3ChannelType">
        <xs:annotation>
            <xs:documentation>
                <p>The ebMS3 Channel Type is a subtype of the Web Service Channel Binding Type. </p>
                <p>Use of an <a href="#ebMS3Channel">ebMS3Channel</a> that is linked to a <a href="#Transport">Transport</a> obliges the 
                    user of the channel to initiate that <a href="#Transport">Transport</a>. 
                    The transport binding is
                    referenced using the <em>transport</em> attribute.
                </p>
                <p>An <a href="#ebMS3Channel">ebMS3Channel</a> MUST NOT be linked 
                    to a <a href="#Transport">Transport</a> element in the following cases:</p>
                <ol>
                    <li>In case of a <em>Pull</em> transport channel binding, which is indicated by 
                        presence of a <a href="#PullHandling">PullHandling</a> child element.</li>
                    <li>In case of a <em>Sync</em> transport channel binding for the response in a Two Way 
                        exchange, which is indicated by the <em>asResponse</em> attribute being present
                        with a true value, and the channel being used by an <a href="#ActionBinding">ActionBinding</a> that 
                        has a <em>replyTo</em> attribute linking the action to a request actions. That 
                        request action then MUST be bound to a channel that provides a backchannel for 
                        the synchronous response. 
                    </li>
                    <li>In case of a synchronous standalone ebMS3 error or receipt signal, also 
                        indicated by the <em>asResponse</em> attribute being present with a true value.</li>
                    <li>In case of a multi-hop message, which is expressed using the value
                        <em>http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/part2/200811/nextmsh</em>
                        for the <em>actorOrRole</em> attribute.
                    </li>
                </ol>
                <p>For these cases, the value of the ebMS3 <em>PMode.MEPbinding</em> parameter can 
                    therefore 
                    be derived from the presence or absence of the <a href="#PullHandling">PullHandling</a> element and the
                    <em>asResponse</em> attribute..
                </p>
                <p>Note that the list is non-exhaustive, because extensions of ebMS3 or CPPA3 may 
                    define additional cases.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:WSChannelType">
                <xs:sequence>
                    <xs:element ref="cppa:ErrorHandling" minOccurs="0"/>
                    <xs:element ref="cppa:ReceiptHandling" minOccurs="0"/>
                    <xs:element ref="cppa:PullHandling" minOccurs="0"/>
                    <xs:element ref="cppa:Compression" minOccurs="0"/>
                    <xs:element ref="cppa:Bundling" minOccurs="0"/>
                    <xs:element ref="cppa:Splitting" minOccurs="0"/>
                    <xs:element ref="cppa:AlternateChannelId" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="cppa:ebMS3ChannelExtension" minOccurs="0" maxOccurs="unbounded"
                    />
                </xs:sequence>
                <xs:attribute name="mpc" type="xs:anyURI" use="optional">
                    <xs:annotation>
                        <xs:documentation>
                            <p>The <em>mpc</em> attribute corresponds to the ebMS3 Core 
                                <em>PMode[1].BusinessInfo.MPC</em> parameter. Its absence is equivalent to
                                presence with the value
                                <em>http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/defaultMPC</em>.
                            </p>
                            <p>Whereas MPC is a <em>BusinessInfo</em> parameter in ebMS3, it is defined at the
                                channel level in CPPA. This allows alternative channels to specify alternative 
                                MPCs.
                            </p>
                            <p>The <em>mpc</em> attribute MUST only be used by channels used by UserMessages.</p>
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="submpcext" type="xs:anyURI" use="optional">
                    <xs:annotation>
                        <xs:documentation>The <em>submpcext</em> attributes corresponds to the 
                                AS4  <em>Pmode[1].BusinessInfo.subMPCext</em> parameter. 
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="actorOrRole" type="xs:anyURI" use="optional">
                    <xs:annotation>
                        <xs:documentation>This attribute can be used to target the ebMS <em>Messaging</em> 
                            header to a particular actor or role. 
                            The value <em>http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/part2/200811/nextmsh</em> 
                            indicates that the message
                            is processed as defined in the Multi-Hop Messaging feature of the ebMS3, 
                            Part 2 Advanced Features specification [EBMS3PART2].  
                            This attribute does not control the actor/role on 
                            other SOAP headers, such as the the WS-Security header. It relates to the
                            P-Mode parameter <em>Pmode[1].Protocol.AddActorOrRoleAttribute</em>.
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="includePmode" type="xs:boolean" default="false">
                    <xs:annotation>
                        <xs:documentation>This attribute can be used to specify if a <em>pmode</em> attribute 
                            is to be included in an ebMS3 message. If the value for 
                            <em>includeAgreementRef</em> is <em>false</em>, this attribute MUST NOT be 
                            set to <em>true</em>. 
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="includeAgreementRef" type="xs:boolean" default="true">
                    <xs:annotation>
                        <xs:documentation>This attribute can be used to specify if an <em>AgreementRef</em> element 
                            is to be included in an ebMS3 message. 
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="errorHandling" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#ErrorHandling">ErrorHandling</a> 
                            element. 
                            If 
                            this attribute is present, there MUST NOT be a 
                            child <a href="#ErrorHandling">ErrorHandling</a>.  </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="receiptHandling" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#ReceiptHandling">ReceiptHandling</a> element. If 
                            this attribute is present, there MUST NOT be a 
                            child <a href="#ReceiptHandling">ReceiptHandling</a>.  </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="compression" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#Compression">Compression</a> element. If 
                            this attribute is present, there MUST NOT be a 
                            child <a href="#Compression">Compression</a>.  
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="splitting" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#Splitting">Splitting</a> element. If 
                            this attribute is present, there MUST NOT be a 
                            child <a href="#Splitting">Splitting</a>.  
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="bundling" type="xs:IDREF">
                    <xs:annotation>
                        <xs:documentation>A reference to a reused <a href="#Bundling">Bundling</a> element. If 
                            this attribute is present, there MUST NOT be a 
                            child <a href="#Bundling">Bundling</a>.  
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>


    <xs:element name="ebMS3ChannelExtension" abstract="true" type="cppa:ebMS3ChannelExtensionType">
        <xs:annotation>
            <xs:documentation>An abstract ebMS3Channel extension element</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ebMS3ChannelExtensionType" abstract="true">
        <xs:annotation>
            <xs:documentation>An abstract ebMS3Channel Extension type</xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:ChannelExtensionType"> </xs:extension>
        </xs:complexContent>
    </xs:complexType>



    <!-- ebMS2 and ebMS3 Error Handling -->

    <xs:element name="ErrorHandling" type="cppa:ErrorHandlingType"
        substitutionGroup="cppa:ChannelFeature">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#ErrorHandling">ErrorHandling</a> element specifies how 
                    errors are handled for the exchange.</p>
                <p>CPPA2 used the <em>defaultMshChannelId</em> attribute on <a href="#PartyInfo">PartyInfo</a> to express the
                    channel to use for asynchronous signals, such as errors. 
                    As a consequence, in CPPA2, either 
                    all errors are signed or none of them is.  
                    In CPPA3, the channel is referenced 
                    from the <em>SenderErrorsReportChannelId</em> and/or <em>ReceiverErrorsReportChannelId</em>
                    elements. As a consequence, in CPPA3 whether errors are to be signed can be specified for 
                    each (synchronous or asynchronous) channel separately.
                </p>
                <p>CPPA2 did not specify if synchronous errors are signed or not. In CPPA3, this can be specified
                    for the referenced channel.</p>
                <p>With ebMS2, ebMS3 and AS4, a reference to a signed channel expresses a recommendation on the 
                    MSH to sign messages using the specified channel. This is a best effort obligation, as it 
                    is not possible or desirable in all circumstances (for example, in case of errors) 
                    to sign the message. </p>
                <p>The ebMS3 and AS4 specifications do not specify if errors are signed or not, and do not 
                    provide PMode parameters to control signing. With CPPA3, this can be configured.</p>
                <p>Absence of the <em>DeliveryFailuresNotifyProducer</em>, 
                    <em>ProcessErrorNotifyConsumer</em> and
                    <em>ProcessErrorNotifyProducer</em>elements is equivalent to
                    being present with a value <em>false</em>.
                </p>
                <p>CPPA3 does not provide a separate element for the 
                    <em>PMode[1].ErrorHandling.Report.MissingReceiptNotifyProducer</em> PMode parameter, 
                    as defined in the AS4 specification for its reception awareness feature [AS4-Profile]. 
                    If reception awareness is used with AS4, this parameter is assumed to be present with a
                    true (or false, respectively) value if the CPPA3 the <a 
                        href="#ProcessErrorNotifyProducer">ProcessErrorNotifyProducer</a> element 
                    is present with a true value (or true, respectively). 
                    Situations where one is true and the other false are not not supported 
                    [EBXMLMSG110].
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ErrorHandlingType">
        <xs:complexContent>
            <xs:extension base="cppa:ChannelFeatureType">
                <xs:sequence>
                    <xs:element minOccurs="0" ref="cppa:DeliveryFailuresNotifyProducer"/>
                    <xs:element minOccurs="0" ref="cppa:ProcessErrorNotifyConsumer"/>
                    <xs:element minOccurs="0" ref="cppa:ProcessErrorNotifyProducer"/>
                    <xs:element minOccurs="0" ref="cppa:SenderErrorsReportChannelId"/>
                    <xs:element minOccurs="0" ref="cppa:ReceiverErrorsReportChannelId"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="ProcessErrorNotifyConsumer" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p/>
                <p>This element corresponds to the ebMS3 
                    <em>PMode[1].ErrorHandling.Report.ProcessErrorNotifyConsumer</em> parameter. 
                    Its definition is provided in the ebMS3 Core Specification. 
                    Absence of the element is equivalent to presence with a false value.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="DeliveryFailuresNotifyProducer" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>This element corresponds to the ebMS3 
                    <em>PMode[1].ErrorHandling.Report.DeliveryFailuresNotifyProducer</em> parameter.
                    Its definition is provided in the ebMS3 Core Specification.                     
                    Absence of the element is equivalent to presence with a false value.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ProcessErrorNotifyProducer" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>This element corresponds to the ebMS3 
                    <em>PMode[1].ErrorHandling.Report.ProcessErrorNotifyProducer</em> parameter.
                    Its definition is provided in the ebMS3 Core Specification.                     
                    Absence of the element is equivalent to presence with a false value.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="SenderErrorsReportChannelId" type="xs:IDREF">
        <xs:annotation>
            <xs:documentation>
                <p>The ebMS3 <em>PMode[1].ErrorHandling.Report.SenderErrorsTo</em> parameter identifies the address 
                    to which to send ebMS errors generated by the MSH that was trying to send the message in error.
                    In CPPA3, the <em>SenderErrorsReportChannelId</em> identifies this channel, which can be configured 
                    as any channel. To avoid errors-on-errors, the identified channel MUST NOT itself 
                    have <a href="#ErrorHandling">ErrorHandling</a> specified. 
                </p>
                
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ReceiverErrorsReportChannelId" type="xs:IDREF">
        <xs:annotation>
            <xs:documentation>
                <p>The ebMS3 <em>PMode[1].ErrorHandling.Report.ReceiverErrorsTo</em> parameter identifies the address
                    to which to send ebMS errors generated by the MSH that receives the message in error; e.g. this 
                    may be the address of the MSH sending the message in error.
                    In CPPA3, the <em>ReceiverErrorsReportChannelId</em> identifies this channel, which can be 
                    configured 
                    as any channel. To avoid errors-on-errors, the identified channel MUST NOT itself 
                    have <a href="#ErrorHandling">ErrorHandling</a> specified. </p>
                <p>The functionality of the ebMS3 <em>PMode[1].ErrorHandling.Report.AsResponse</em> is expressed 
                    by the presence of an <em>asResponse</em> attribute with value <em>true</em> and absence of a 
                    specified <a href="#Transport">Transport</a> for the referenced channel</p>
                <p>For use with the multihop feature defined in [EBMS3PART3], the use of WS-Addressing 
                    as specified in the 
                    <em>Pmode[1].Errorhandling.Report.SenderErrorsTo.Addressing</em>                    
                    parameter and its sub-parameters is specified with the referenced channel.
                    Similarly, to specify, for the parameter 
                    <em>Pmode[1].ErrorHandling.Report.ReceiverErrors.ReplyPattern</em>, the value “pull” defined 
                    in section 6.5 of [EBMS3PART2], the referenced channel can specify a <a href="#PullHandling">PullHandling</a>
                    element.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- Receipt Handling -->

    <xs:element name="ReceiptHandling" type="cppa:ReceiptHandlingType"
        substitutionGroup="cppa:ChannelFeature">
        <xs:annotation>
            <xs:documentation>
                <p>Presence of the <a href="#ReceiptHandling">ReceiptHandling</a> element indicates that 
                    message receipts must be
                    reported by a <em>Receipt</em> signal. Absence of the element indicates that 
                    no <em>Receipt</em> is to be transmitted. </p>
                <p>For protocols like ebMS2 and EDIINT the sender is expected to indicate in the message whether 
                    or not a receipt is requested. The presence or absence of this element SHOULD be set in 
                    accordance with presence or absence of <a href="#ReceiptHandling">ReceiptHandling</a>.
                </p>
                <p>When used with EDIINT, the type of receipt (signed or unsigned) and the channel 
                    (synchronous or asynchronous) to be used can be requested by the sending MSH.  In a <a href="#CPA">CPA</a>, the  
                    <a href="#ReceiptHandling">ReceiptHandling</a> element expresses an agreement behaviour using the 
                    definition of the referenced <a href="#ReceiptChannelId">ReceiptChannelId</a>. 
                </p>
                <p>The <a href="#ReceiptHandling">ReceiptHandling</a> element has two sub-elements:</p>
                <ul>
                    <li>The <a href="#ReceiptFormat">ReceiptFormat</a> MUST NOT be used in protocols that 
                        have a single pre-defined receipt 
                        format. In EDIINT, the receipt format is fixed to be a MIME multipart/report with 
                        a report-type of 
                        <em>disposition-notification</em>. The <a href="#ReceiptFormat">ReceiptFormat</a> 
                        element therefore MUST NOT be used.
                        As AS4 supports two types of receipts,
                        the <a href="#ReceiptFormat">ReceiptFormat</a> element MUST be provided for each 
                        AS4 <a href="#ebMS3Channel">ebMS3Channel</a>.</li>
                    <li>The <a href="#ReceiptChannelId">ReceiptChannelId</a> element specifies the channel 
                        to use to exchange receipts.</li>
                </ul>
                
                <h3>EDIINT</h3>

                <p>For EDIINT, the <a href="#ReceiptHandling">ReceiptHandling</a> element configures the 
                    processing of EDIINT Message Disposition 
                    Notifications (MDNs).
                    In a <a href="#CPP">CPP</a> <a href="#ReceiptHandling">ReceiptHandling</a> configures the receipt 
                    processing that a Party expects.  In a <a href="#CPA">CPA</a>, it configures the receipt processing 
                    that a Party and its CounterParty have agreed to.  If a <a href="#ReceiptHandling">ReceiptHandling</a> element is present, an 
                    MDN SHOULD be requested. 
                    In EDIINT, such a request is made using the MDN-request-header <em>Disposition-notification-to</em>. 
                    If a <a href="#ReceiptHandling">ReceiptHandling</a> element is not present, an MDN SHOULD NOT be 
                    requested and the MDN-request-header 
                    SHOULD NOT be present.
                </p>
                <p>In CPPA3, the receipt channel identified using the <a href="#ReceiptChannelId">ReceiptChannelId</a> 
                    element in 
                    <a href="#ReceiptHandling">ReceiptHandling</a> element in an EDIINT channel is the channel over 
                    which receipts are exchanged. 
                    For EDIINT, the identified channel MUST be of a subtype of <em>EDIINTChannel</em>.
                    Note that AS2 allows MDNs to be returned using SMTP.  In that case, the referring 
                    <em>EDIINTChannel</em> is 
                    an <a href="#AS2Channel">AS2Channel</a> that includes <a href="#ReceiptChannelId">ReceiptChannelId</a> that actually identifies an 
                    <a href="#AS2Channel">AS2Channel</a> bound to an SMTP transport.
                </p>
                <p>In CPPA3,  synchronous or asynchronous processing of EDIINT receipts is expressed 
                    by the <em>asResponse</em> and 
                    <em>transport</em> attributes. </p>
                <p>AS1 only supports asynchronous MDNs. The Receiver is expected to return the MDN to the address 
                    specified in the 
                    <em>Disposition-notification-to</em> header on the message for which a receipt is requested.   
                    In CPPA3, the <em>asResponse</em> attribute on the referenced <a href="#ReceiptChannelId">ReceiptChannelId</a> MUST be absent or present with a 
                    false value. The <em>transport</em> attribute is REQUIRED and MUST specify an SMTP transport. 
                    Its value is
                    the address the MDN is sent to.
                </p>
                <p>AS2 supports synchronous and asynchronous MDNs:</p>
                <ul>
                    <li>If the <em>asResponse </em>attribute is present on the receipt channel with the 
                        value <em>true</em>, the channel 
                        is a synchronous channel, which uses the backchannel offered by the <a href="#AS2Channel">AS2Channel</a> on which the 
                        <a href="#ReceiptHandling">ReceiptHandling</a> element occurs. 
                        In this case, the <em>transport</em> attribute MUST NOT be present. </li>
                    <li>If the <em>asReponse</em> attribute is absent, or present with a value <em>false</em>, 
                        the channel is an 
                        asynchronous channel. It uses a separate transport connection that is identified using 
                        the value of the 
                        <em>transport</em> attribute, which MUST be present and which MUST reference an 
                        EDIINT transport.
                        The value of the <a href="#Endpoint">Endpoint</a> element in the referenced transport 
                        SHOULD be used as value for the 
                        <em>Receipt-Delivery-Option</em>. 
                        Note that AS2 allows MDNs to use other transports than HTTP. 
                    </li>
                </ul>
                <p>AS3 only supports asynchronous MDNs.</p>
                <p>For signed messages, AS2 and AS3 specify that the algorithm used to calculate the MIC MUST be
                    the same as that used on the message that was signed. In CPPA3, this is a constraint on the 
                    <a href="#SignatureAlgorithm">SignatureAlgorithm</a> element in <a href="#Signature">Signature</a> on the referenced <a href="#ReceiptChannelId">ReceiptChannelId</a>. 
                    If the message is not signed, then AS2 and AS3 specify that the SHA-1 algorithm 
                    SHOULD be used. </p>
                <p>In EDIINT, a signed MDN can be requested by setting the <em>signed-receipt-protocol</em>  
                    and <em>signed-receipt-micalg</em> headers.  If signing of EDIINT MDNs is expected to be 
                    requested, in CPPA3:                    
                </p>
                <ul>
                    <li>The channel referenced using <a href="#ReceiptChannelId">ReceiptChannelId</a> MUST 
                        have a <a href="#Signature">Signature</a> element. </li>
                    <li>This <a href="#Signature">Signature</a> element MAY contain a <em>SignatureFormat</em>. 
                        For AS2 and AS3, the only accepted value is <em>pkcs7-signature</em>. This selects the 
                        S/MIME detached signature format.
                        For AS1, the accepted values are <em>pkcs7-signature</em> and <em>pgp-signature</em>.  
                    </li>
                    <li>This <a href="#Signature">Signature</a> element MUST also contain one of  
                        more <a href="#SignatureAlgorithm">SignatureAlgorithm</a> elements.
                        To select one of the two supported values for MIC algorithm, the value of the 
                        <a href="#SignatureAlgorithm">SignatureAlgorithm</a> 
                        element or elements MAY be set to <em>http://www.w3.org/2000/09/xmldsig#sha1</em> or 
                        <em>http://www.w3.org/2001/04/xmldsig-more#md5</em>. These values translate to 
                        the <em>sha1</em> and 
                        <em>md5</em> &lt;micalg&gt; values. Note that, while RFC4130 only supports SHA1 and MD5, 
                        EDIINT 
                        implementations support more modern algorithm like sha-224, sha-256, sha-384 and sha-512.       
                    </li>
                </ul>
                <p>Note that in EDIINT, MDNs can be requested per message and the configuration can be set per 
                    message. 
                    This means that EDIINT software MAY override the CPPA3 configuration at runtime. In case an 
                    MDN is
                    not requested by the sender but the Receiver is expecting a request, the expected behaviour 
                    is undefined in this specification.
                </p>

                <h3>ebMS3 Core</h3>
                
                <p>In ebMS3 Core, receipt handling is considered part of the security
                    processing mode parameters as it is closely linked to non-repudiation of receipt.
                    CPPA3 defines receipt handling as a feature of the <a href="#ebMS3Channel">ebMS3Channel</a>. 
                    This element 
                    provides the functionality of the ebMS3 <em>PMode[1].Security.SendReceipt</em> parameter.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ReceiptHandlingType">
        <xs:complexContent>
            <xs:extension base="cppa:ChannelFeatureType">
                <xs:sequence>
                    <xs:element minOccurs="0" ref="cppa:ReceiptFormat"/>
                    <xs:element minOccurs="1" ref="cppa:ReceiptChannelId"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="ReceiptFormat">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#ReceiptFormat">ReceiptFormat</a> allows choice of the receipt format to be used for 
                    protocols like ebMS3 that support multiple receipt formats, which can be profiled
                    in profiles such as AS4.  
                </p>
                <p>When used with AS4, the allowed values are 
                    <em>NonRepudiationInformation</em> for Non-Repudation 
                    of Receipt or
                    <em>UserMessage</em> for Reception Awareness. 
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="cppa:non-empty-string"/>
        </xs:simpleType>
    </xs:element>

    <xs:element name="ReceiptChannelId" type="xs:IDREF">
        <xs:annotation>
            <xs:documentation>
                <h3>Definition</h3>

                <p>
                    The <a href="#ReceiptChannelId">ReceiptChannelId</a> element references the channel 
                    over which a receipt 
                    is exchanged. As receipts themselves are not sent reliably, the referenced channel MUST NOT 
                    itself specify any <a href="#ReceiptHandling">ReceiptHandling</a>.
                </p>
                <h3>ebMS3</h3>
                <p>The ebMS3 <em>PMode[1].Security.SendReceipt.ReplyPattern</em> parameter indicates 
                    whether the Receipt signal is to be sent as a callback (value "callback"), or synchronously in 
                    the back-channel response (value "response"). In CPPA3, this (and more) information is defined 
                    for the referenced channel.  
                    The referenced channel also specifies any <em>Pmode[1].Security.SendReceipt.ReplyTo</em> value.
                    In [EBMS3PART2], an additional value <em>pull</em> is defined to allow pulling of receipts in a
                    multihop context. This is achieved in CPPA3 by specifying a <a href="#PullHandling">PullHandling</a> element for
                    the receipt channel.
                </p>
                <p>When used with a Web Services Reliable Messaging protocol, the channel also covers 
                    the <em>PMode[1].Reliability.AtLeastOnce.Contract.AcksTo</em>, 
                    <em>PMode[1].Reliability.AtLeastOnce.Contract.AckResponse</em> and
                    <em>PMode[1].Reliability.AtLeastOnce.ReplyPattern</em> parameters.
                </p>
                <h3>EDIINT</h3>
                <p>When used with EDIINT, if the referenced receipt channel is signed, the sending
                    MSH MUST request a signed MDN.  If the referenced receipt channel is not signed, 
                    the sending MSH MUST not request a signed MDN.
                </p>
                <h3>CPPA2</h3>
                <p>The <a href="#ReceiptChannelId">ReceiptChannelId</a> element replaces the functions of three 
                    CPPA2 elements 
                    and attributes: </p>
                <ol>
                    <li>The <em>syncReplyMode</em> attribute on <em>MessagingCharacteristics</em> in CPPA2 can be 
                        used to 
                        specify whether receipts are expected synchronously or asynchronously. In CPPA3, this is a 
                        characteristic of the referenced receipt channel.</li>
                    <li>CPPA2 used the <em>defaultMshChannelId</em> attribute on <a href="#PartyInfo">PartyInfo</a> to express the
                        channel to use for asynchronous signals, such as receipts. In CPPA3, the channel is referenced 
                        from an <em>ebMS2ReliableMessaging</em> element. 
                        In CPPA2, either all receipts are signed or none. In CPPA3, this can be specified for 
                        each (synchronous or asynchronous) channel separately.</li>
                    <li>In CPPA2, the <em>ackSignatureRequested</em> attribute on <em>MessagingCharacteristics</em> 
                        expressed whether the receipt message is to be signed. Whereas this can be specified for 
                        each channel, only one asynchronous channel could be specified for receipts, which can only be 
                        signed or unsigned. 
                        In CPPA3 it is possible to specify that some asynchronous receipts are to be signed and 
                        others not.</li>
                </ol>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="PullHandling">
        <xs:annotation>
            <xs:documentation>
                <p>This element configures the use of ebMS3 pulling to transfer user messages.
                    It specifies the channel that the pull request MUST use. 
                </p>
                <p>Extension elements can be added to the content of this element to further configure pull handling. 
                    Such extensions could be product-specific or defined in profiles.    
                </p>
                <p>Note that the MPC to pull from is specified in the ebMS3Channel used by the (pulled) user message, 
                    not in the pull channel.
                </p>
                <p>When using reliable messaging, the referenced channel MAY have its own specification 
                    on whether it uses reliable messaging. This means 
                    that the <em>Pmode[1].Reliability.AtLeastOnce.Contract.ReliablePull</em> 
                    parameter defined in [EBMS3PART2] 
                    is not needed, as the use of reliable messaging for the pull signal is specified independently of the
                    use of reliable messaging for the user messages being pulled.
                </p>
                <p>Similarly, the referenced channel MAY specify the use of WS-Addressing, thus covering the  
                    <em>Pmode[1].Reliability.AtLeastOnce.Contract.AcksTo.Addressing</em> and 
                    <em>Pmode[1].Reliability.AtLeastOnce.Contract.AcksTo.Addressing.EPR</em> parameters.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:PullChannelId" maxOccurs="1"/>
                <xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"
                />
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="PullChannelId" type="xs:IDREF">
        <xs:annotation>
            <xs:documentation>
                <p>
                    If the <a href="#PullChannelId">PullChannelId</a> element is specified for a <a href="#Channel">Channel</a> associated
                    with an action binding, the 
                    <a href="#ebMS3Channel">ebMS3Channel</a> exchanges the ebMS3 message for this action 
                    using the <em>Pull</em> 
                    transport channel binding. 
                    The <em>Pull</em> request uses the referenced channel <a href="#PullChannelId">PullChannelId</a>, 
                    which itself MUST have an associated <a href="#Transport">Transport</a> element.  
                    That channel provides an 
                    anonymous back-channel that this referring document exchange uses. 
                    The <a href="#Channel">Channel</a> for the action binding MUST NOT itself be linked to a 
                    <a href="#Transport">Transport</a>.
                </p>
                <p>The referenced channel MUST be a channel of type <a href="#ebMS3Channel">ebMS3Channel</a>. If the pull 
                    channel is to be authorized using a WS-Security header targeted to <em>ebms</em> actor or role 
                    (see ebMS3 Core, section 7.10), then the referenced channel MUST have a 
                    <em>cppa3:WSSecurityBinding</em> element with an <em>ebms</em> value for the attribute 
                    <em>actorOrRole</em> which has a <em>UserAuthentication</em> element. 
                    That element corresponds to the 
                    ebMS3 
                    <em>PMode.{Initiator/Reponder}Responder.Authorization.{username/password}</em> parameters.
                </p>
                <p>If the <a href="#PullChannelId">PullChannelId</a> element is specified, then the 
                    <em>asResponse</em> attribute 
                    MUST NOT be specified with a value <em>true</em> and the <em>transport</em> attribute MUST 
                    be absent.</p>
                <p>
                    If the <a href="#PullChannelId">PullChannelId</a> element is not specified for a 
                    <a href="#Channel">Channel</a>, 
                    and a <em>transport</em> attribute is specified, the message is exchanged using 
                    a <em>Push</em> transport channel binding. 
                    This <a href="#Channel">Channel</a> MUST be linked to a <a href="#Transport">Transport</a> that specifies 
                    the connection to be set up for the exchange.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- WS-Addressing -->

    <xs:element name="Addressing" type="cppa:AddressingType" substitutionGroup="cppa:ChannelFeature">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#Addressing">Addressing</a> element supports presence and configuration of 
                    WS-Addressing headers 
                    in Web Services messaging. </p>
                <p>The <a href="#Endpoint">Endpoint</a> element configures the <em>wsa:To</em> element.</p>
                <p>The <em>Address</em> element configures the <em>wsa:Action</em> element. </p>
                
                <p>The use of any of the sub-elements and the semantics of their presence or absence MAY be
                    further specified in message protocols or profiles that use this element.                   
                </p>
                
                <p>CPPA3 does not provide a separate <em>FaultTo</em> element to statically configure agreed 
                    fault channels.  
                    It can be specified
                    using the <a href="#Endpoint">Endpoint</a> and reference parameter elements on a separate 
                    channel that is referenced 
                    using the <em>FaultChannelId</em> on a <em>FaultHandling</em> element on the channel.  
                </p>
                <p>CPPA3 does not provide a separate <em>ReplyTo</em> element  to statically configure agreed 
                    response channels. 
                    In a Two Way message 
                    exchange, the <a href="#ActionBinding">ActionBinding</a> for the response action has its 
                    own channel 
                    definition which can include its own WS-Addressing <a href="#Endpoint">Endpoint</a> and 
                    reference parameters.
                </p>                
                <p>The <em>RelatesTo</em> and <em>MessageId</em> elements are per-message elements and are not
                    configured at the channel level.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="AddressingType">
        <xs:complexContent>
            <xs:extension base="cppa:ChannelFeatureType">
                <xs:sequence>
                    <xs:element ref="cppa:Endpoint"/>
                    <xs:element ref="cppa:Action"/>
                    <xs:element ref="cppa:From" minOccurs="0"/>
                    <xs:element ref="cppa:AbsReferenceParameter" minOccurs="0" maxOccurs="unbounded"
                    />
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="Action" type="cppa:ActionType">
        <xs:annotation>
            <xs:documentation>A Web Services <em>Action</em>.</xs:documentation>
        </xs:annotation>

    </xs:element>

    <xs:complexType name="ActionType">
        <xs:sequence>
            <xs:element ref="cppa:Description" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:anyURI">
            <xs:annotation>
                <xs:documentation>The <em>name</em> value of the action.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:element name="From" type="cppa:EndpointReferenceType">
        <xs:annotation>
            <xs:documentation>
                <p>This element allows a <a href="#Channel">Channel</a> to set the <a href="#From">From</a> header value in 
                    Web Services <a href="#Addressing">Addressing</a>.
                </p>
                <p>Note that message protocols or profiles MAY have conventions to derive the
                    value of this header from other content in the CPPA3 document, such as 
                    the <a href="#PartyId">PartyId</a> element.  If that is the case, the element
                    MUST NOT be used in the CPPA3 document.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="EndpointReferenceType">
        <xs:annotation>
            <xs:documentation>
                <p>This type definition defines a WS-Addressing <em>EndpointReferenceType</em>. 
                    In the CPPA3 schema 
                    it is only used for the <a href="#From">From</a> element as the <em>FaultTo</em> 
                    and <em>ReplyTo</em> 
                    endpoints are determined using the <em>FaultHandling</em> and <a href="#ReceiptHandling">ReceiptHandling</a>
                    elements.
                </p>
                <p>No <em>Metadata</em> element is provided, as CPPA3 provides mechanisms to 
                    statically define 
                    behavior, policies and capabilities of the endpoint.  This does not preclude 
                    Web Services-based message protocols or profiles described using CPPA3 to 
                    include dynamic metadata in SOAP messages.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="cppa:Endpoint"/>
            <xs:element ref="cppa:AbsReferenceParameter" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>


    <xs:element name="AbsReferenceParameter" abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>The <em>AbsReferenceParameter</em> element is an abstract element that can be
                    substituted by either a <em>ReferenceParameter</em> structure or by elements 
                    that describe how such parameters are to be constructed.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="AbsReferenceParameterType" abstract="true">
        <xs:annotation>
            <xs:documentation>The abstract type of an <em>AbsReferenceParameter</em>.</xs:documentation>
        </xs:annotation>
    </xs:complexType>

    <xs:element name="ebMS3InferredRoutingInput" substitutionGroup="cppa:AbsReferenceParameter"
        type="cppa:ebMS3RoutingInputType">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies a <em>RoutingInput</em> reference parameter as specified in
                    the ebMS3 Part 2, Advanced Features specification, of which the content is derived
                    from the content of a related ebMS3 <em>UserMessage</em> for use in multi-hop messaging.  
                    The specification distinguishes two situations:
                </p>
                <ul>
                    <li><em>RoutingInput</em> attached to an ebMS3 initiating signal message, in 
                        particular to 
                        a <em>Pull</em> signal message. The content of the <em>RoutingInput</em> is 
                        specified in section 2.6.1 of [EBMS3PART], item (2) of the numbered list, 
                        second option,
                        <em>The EPR for the request signal to pull a user message can be inferred from the 
                            P-Mode as follows ...</em>. 
                    </li>
                    <li><em>RoutingInput</em> attached to response messages, in particular to 
                        ebMS3 response signals such as errors and receipts.
                        The content of the reference parameter is generated as 
                        specified in section 2.6.2 of [EBMS3PART], item (4) of the numbered list, 
                        <em>Inferred RoutingInput for the reverse path</em>.
                    </li>
                </ul>
                <p>Common to all inferred <em>RoutingInput</em> parameters is that:</p>
                <ul>
                    <li>The content of the <a href="#From">From</a> and <em>To</em> elements is swapped.</li>
                    <li>The value of the <em>Service</em> element and its <em>type</em> attribute are copied.</li>
                    <li>The content of the <em>Action</em> element and <em>mpc</em> attribute 
                        are set to 
                        the values of the related user message, concatenated with optional suffixes specified in 
                        <em>ActionSuffix</em> and <em>MPCSuffix</em> element respectively. </li>
                </ul>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ebMS3RoutingInputType">
        <xs:complexContent>
            <xs:extension base="cppa:AbsReferenceParameterType">
                <xs:sequence>
                    <xs:element ref="cppa:ActionSuffix" minOccurs="0"/>
                    <xs:element ref="cppa:MPCSuffix" minOccurs="0"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="ActionSuffix" type="xs:string">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies a string that MUST be appended to the value of the <em>Action</em> element in 
                    the user message from which the reference parameter is derived.
                </p>
                <p>The value <em>.pull</em> is the value specified in the second of the last three bullets in section
                    2.6.1 of [EBMS3PART2].
                </p>
                <p>The value <em>.response</em> 
                    is the value specified in the second bullet in the section 2.6.2 of [EBMS3PART2], 
                    item (4) section.  </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="MPCSuffix" type="xs:string">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies a string that MUST be appended to the value of the <em>mpc</em> attribute 
                    in the user message from which the reference parameter is derived.
                    The value <em>.response</em> 
                    is the value specified in the second bullet in the section 2.6.2 of [EBMS3PART2], 
                    item (4) section.  
                </p>
                <p>If no <em>mpc</em> attribute is present in the user message from which the reference parameter is
                    derived, the reference parameter is to include an <em>mpc</em> attribute the value of which is
                    the concatenation of the default MPC value
                    <em>http://docs.oasis-open.org/ebxml-msg/ebms/v3.0/ns/core/200704/defaultMPC</em> followed by the
                    specified suffix.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- Bundling -->

    <xs:element name="Bundling" substitutionGroup="cppa:ChannelFeature" type="cppa:BundlingType">
        <xs:annotation>
            <xs:documentation>
                <p>This element enables support of a subset of the ebMS3 Part 2 Bundling feature, which allows multiple
                    user messages to be transferred in a single ebMS3 message. In the Part 2
                    specification, Bundling is configured per P-Mode.  Bundling of different types of messages is 
                    expressed as cross-references between P-Modes.  
                </p>
                <p>In this CPPA3 schema, Bundling is defined at
                    the level of ebMS3 channels.  If distinct actions are bound to a single ebMS3 channel with a 
                    Bundling element, then user messages for these actions MAY be bundled subject 
                    to the constraints specified in the element.  This is similar to the 
                    <em>Pmode[].bundling.compatibility.pmodelist</em> parameter. However, it means that in CPPA3 
                    bundling can only be defined for P-Modes that have the same values for the P-Mode parameters that are
                    determined by the ebMS3Channel.
                </p>
                <p>Presence of the <em>Bundling</em> element is equivalent to the <em>Pmode[].bundling.policy</em>
                    with value <em>optional</em>.
                </p>
                <p>Bundling can be configured using the following sub-elements:</p>
                <ol>
                    <li>The element <a href="#MaxSize">MaxSize</a> expresses the maximum size for the bundle. It encodes the
                        <em>Pmode[].bundling.maxsize</em> P-Mode parameter. This parameter defines the maximum size of a 
                        message resulting from bundling. It includes the size of the SOAP envelope and any payloads in 
                        MIME attachments. 
                    </li>
                    <li>The element <em>MaxDelay</em> encodes the <em>Pmode[].bundling.maxdelay</em> P-Mode
                        parameter. This parameter (of type duration) defines the maximum time between the oldest message 
                        unit and the newest message unit in a bundle, based on the <em>eb3:MessageInfo/eb3:Timestamp</em> 
                        values of the message units. A receiving MSH SHOULD validate that the bundles satisfies 
                        this requirement. A sending MSH MAY use this parameter to determine, for a submitted message 
                        unit, to bundle it with other submitted messages , to send it by itself (as an unbundled 
                        message) or to defer sending it (as other message units may be submitted later 
                        that it could be bundled with).
                    </li>
                    <li>The <em>Policy</em> element encodes the <em>Pmode[].bundling.ordering.policy</em> parameter.
                        In [EBMS3PART2], this element is defined to have three values for <em>Policy</em>.  Absence of 
                         the CPPA3 <em>Ordering</em> element is equivalent to the ebMS3 P-Mode being present with 
                        value <em>undefined</em> for <em>Policy</em>. 
                        If the <em>Ordering</em> element is present, the <em>Policy</em> element MUST be present with a 
                        value that indicates which of the other two policies applies to the channel.
                    </li>
                    <li>The <em>Scope</em> element encodes the <em>Pmode[].bundling.ordering.scope</em> 
                        P-Mode parameter.</li>
                </ol>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="BundlingType">
        <xs:complexContent>
            <xs:extension base="cppa:ChannelFeatureType">
                <xs:sequence>
                    <xs:element ref="cppa:MaxSize" minOccurs="0"/>
                    <xs:element name="MaxDelay" type="xs:duration" minOccurs="0"/>
                    <xs:element name="Ordering" minOccurs="0">
                        <xs:complexType>
                            <xs:sequence>
                                <xs:element name="Policy" minOccurs="1">
                                    <xs:simpleType>
                                        <xs:restriction base="xs:token">
                                            <xs:enumeration value="documentorder"/>
                                            <xs:enumeration value="timestamp"/>
                                        </xs:restriction>
                                    </xs:simpleType>
                                </xs:element>
                                <xs:element name="Scope" minOccurs="0">
                                    <xs:complexType>
                                        <xs:sequence>
                                            <xs:element ref="cppa:Expression" minOccurs="1"/>
                                        </xs:sequence>
                                    </xs:complexType>
                                </xs:element>
                            </xs:sequence>
                        </xs:complexType>
                    </xs:element>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Split, Join, Compress -->

    <xs:element name="Splitting" substitutionGroup="cppa:ChannelFeature" type="cppa:SplittingType">
        <xs:annotation>
            <xs:documentation>
                <p>This element configures the use of the ebMS3 Part 2 Split, Join, Compress 
                    Advanced Feature.</p>
                <p>Presence of this element in an <a href="#ebMS3Channel">ebMS3Channel</a>  
                    is equivalent to presence of 
                    the <em>Pmode[].Splitting</em> P-Mode parameter.
                    The structure of the element reflects the P-Mode parameters defined for the feature:
                </p>
                <ul>
                    <li>The <a href="#Splitting_FragmentSize">FragmentSize</a> element encodes 
                        the <em>Pmode[].Splitting.FragmentSize</em> P-Mode
                        parameter. </li>
                    <li>The optional list of <a href="#Property">Property</a> elements 
                        encodes the <em>Pmode[].Splitting.RoutingProperties</em> 
                        P-Mode parameter.  Alternatively, a set of properties can be
                        referenced using the <em>propertySetId</em> attribute.
                    </li>
                    <li>The <a href="#JoinInterval">JoinInterval</a> encodes 
                        the <em>Pmode[].Splitting.JoinInterval</em> parameter.</li>
                </ul>
                <p>The definition of the <a href="#ebMS3Channel">ebMS3Channel</a> that contains the
                    <a href="#Splitting">Splitting</a> applies to fragment messages.  The channel
                    definition as it applies to the source (and hence target) message is 
                    configured using an <a href="#ebMS3Channel">ebMS3Channel</a> referenced using the  
                    <a href="#SourceChannelId">SourceChannelId</a> element.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="SplittingType">
        <xs:complexContent>
            <xs:extension base="cppa:ChannelFeatureType">
                <xs:sequence>
                    <xs:element name="FragmentSize" minOccurs="0" type="cppa:SizeType"/>
                    <xs:element ref="cppa:Property" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="cppa:CompressionAlgorithm" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="cppa:JoinInterval" minOccurs="0"/>
                    <xs:element ref="cppa:SourceChannelId" minOccurs="0" />
                </xs:sequence>
                <xs:attribute name="propertySetId" type="xs:IDREF" use="optional">
                    <xs:annotation>
                        <xs:documentation>A reference to a set of properties used for routing purposes.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="JoinInterval" type="xs:duration">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#JoinInterval">JoinInterval</a> encodes the 
                    <em>Pmode[].Splitting.JoinInterval</em> P-Mode parameter defined in
                    [EBMS3PART2]. </p>
                <p>This element MAY be specified in a <a href="#CPP">CPP</a> for a Receiver transport. 
                    It SHOULD NOT be set for a Sender transport.
                    In <a href="#CPA">CPA</a> formation, the value to be included in the 
                    <a href="#CPA">CPA</a> is the Receiver value,  if present.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="SourceChannelId" type="xs:IDREF">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#SourceChannelId">SourceChannelId</a> is a reference to a definition
                    of the channel as it applies to the source message in case 
                    <a href="#Splitting">Splitting</a> is used and the source message channel differs
                    from the fragment channel.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- Alternate Channel -->

    <xs:element name="AlternateChannelId" type="xs:IDREF">
        <xs:annotation>
            <xs:documentation>
                <p>This references an alternate channel that can be used by an MSH to make available
                    messages that could not be exchanged using the channel that references it. Multiple 
                    occurrences of an <a href="#AlternateChannelId">AlternateChannelId</a> express 
                    multiple alternative options.  
                </p>
                <p>This supports an advanced feature of ebMS3 Part 2, called <em>Alternate MEP</em>, 
                    which limits its use to offering a <em>Pull</em>-based access to response messages in 
                    a synchronous Two Way MEP that could not be delivered in time to be transmitted over the 
                    backchannel. That feature requires that at most one alternate channel is present.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- AS4 Reception Awareness and Reliable Messaging -->

    <xs:element name="AS4ReceptionAwareness" substitutionGroup="cppa:ReliableMessagingBinding">
        <xs:annotation>
            <xs:documentation>
                <p>The element configures the use of AS4 Reception Awareness.</p>
                <p>The structure inherited from <a href="#ReliableMessagingBinding">ReliableMessagingBinding</a> provides 
                    structure to configure the parameters
                    <em>PMode[1].ReceptionAwareness</em>,
                    <em>PMode[1].ReceptionAwareness.Retry</em>,
                    <em>PMode[1].ReceptionAwareness.Retry.Parameters</em>,
                    <em>PMode[1].ReceptionAwareness.DuplicateDetection</em> and
                    <em>PMode[1].ReceptionAwareness.DetectDuplicates.Parameters</em>.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:ReliableMessagingBindingType">
                    <xs:sequence> </xs:sequence>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="WSReliableMessagingBinding" substitutionGroup="cppa:ReliableMessagingBinding">
        <xs:annotation>
            <xs:documentation>
                <p>The element configures the use of Web Services Reliable Messaging.</p>
                <p>When used with WS-ReliableMessaging, the <a href="#ReceiptHandling">ReceiptHandling</a> element MUST
                    be included. When creating sequences, the <em>wsa:AcksTo</em> header value 
                    MUST be taken from the channel identified in the <a href="#ReceiptChannelId">ReceiptChannelId</a> 
                    element in <a href="#ReceiptHandling">ReceiptHandling</a>. 
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:ReliableMessagingBindingType">
                    <xs:sequence>
                        <xs:element name="Protocol" minOccurs="1">
                            <xs:simpleType>
                                <xs:restriction base="xs:anyURI">
                                    <xs:enumeration
                                        value="http://docs.oasis-open.org/ws-rx/wsrm/v1.1/">
                                        <xs:annotation>
                                            <xs:documentation>WS-ReliableMessaging v1.1</xs:documentation>
                                        </xs:annotation>
                                    </xs:enumeration>
                                    <xs:enumeration
                                        value="http://docs.oasis-open.org/ws-rx/wsrm/v1.2/">
                                        <xs:annotation>
                                            <xs:documentation>WS-ReliableMessaging v1.2</xs:documentation>
                                        </xs:annotation>
                                    </xs:enumeration>
                                    <xs:enumeration
                                        value="http://docs.oasis-open.org/wsrm/2004/06/ws-reliability-1.1.xsd">
                                        <xs:annotation>
                                            <xs:documentation>WS-Reliability v1.1</xs:documentation>
                                        </xs:annotation>
                                    </xs:enumeration>
                                </xs:restriction>
                            </xs:simpleType>
                        </xs:element>
                        <xs:element ref="cppa:ReceiptHandling" minOccurs="0"/>
                        <xs:element name="AckOnDelivery" type="xs:boolean" minOccurs="0">
                            <xs:annotation>
                                <xs:documentation>
                                    <p>This element corresponds to the 
                                        <em>PMode[1].Reliability.AtLeastOnce.Contract.AckOnDelivery</em> parameter.
                                    This Boolean parameter indicates the semantics of acknowledgments that are 
                                    generated by the reliability module.  See section 8.2 of [EBMS3CORE] for
                                    specification.
                                    </p>
                                </xs:documentation>
                            </xs:annotation>
                        </xs:element>
                        <xs:element name="InOrder" type="xs:boolean" minOccurs="0">
                            <xs:annotation>
                                <xs:documentation>
                                    <p>This element corresponds to the 
                                        <em>PMode[1].Reliability.InOrder.Contract</em> parameter. See section 
                                        8.2 of [EBMS3CORE] for
                                        specification.</p>
                                </xs:documentation>
                            </xs:annotation>
                        </xs:element>
                        <xs:element name="StartGroup" type="xs:boolean" minOccurs="0">
                            <xs:annotation>
                                <xs:documentation>
                                    <p>This parameter is a Boolean that indicates if messages matching this 
                                        P-Mode MUST be associated with a new reliability group or sequence. 
                                        For example, a particular <em>Service</em> and <em>Action</em> 
                                        may have the application semantics of 
                                        initiating a new ordered sequence of messages.</p>
                                    <p>PMode parameter <em>PMode[1].Reliability.StartGroup</em>.</p>
                                </xs:documentation>
                            </xs:annotation>
                        </xs:element>
                        <xs:element name="Correlation" minOccurs="0">
                            <xs:annotation>
                                <xs:documentation>
                                    <p>This element maps to the ebMS3 PMode parameter 
                                        <em>PMode[1].Reliability.Correlation</em>g.</p>
                                    <p>In ebMS3 Core, the following definition is provided: 
                                        This parameter tells how to correlate a message with an existing
                                        reliability group or sequence. It is a comma-separated list of
                                        XPath elements. Each one of these XPaths identifies an element or 
                                        attribute inside an <em>eb:UserMessage</em> or <em>eb:SignalMessage</em>, 
                                        and may include predicates.
                                    </p>
                                    <p>The content is a list of XPath <a href="#Expression">Expression</a> element.</p>
                                </xs:documentation>
                            </xs:annotation>
                            <xs:complexType>
                                <xs:sequence>
                                    <xs:element ref="cppa:Expression" minOccurs="1"
                                        maxOccurs="unbounded"/>
                                </xs:sequence>
                            </xs:complexType>
                        </xs:element>
                        <xs:element name="TerminateGroup" type="xs:boolean" minOccurs="0">
                            <xs:annotation>
                                <xs:documentation>
                                    <p>This parameter is a Boolean value that may be used to indicate if messages matching 
                                        this P-Mode must cause the closure of the reliability group or sequence with which 
                                        they correlate.</p>
                                    <p>PMode parameter <em>PMode[1].Reliability.TerminateGroup</em>.</p>
                                </xs:documentation>
                            </xs:annotation>
                        </xs:element>
                    </xs:sequence>
                    <xs:attribute name="receiptHandling" type="xs:IDREF">
                        <xs:annotation>
                            <xs:documentation>A reference to a reused <a href="#ReceiptHandling">ReceiptHandling</a> element. If 
                                this attribute is present, there MUST NOT be a 
                                child <a href="#ReceiptHandling">ReceiptHandling</a>.  </xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <!--  Transport Channel Binding -->

    <xs:element name="TransportChannel" substitutionGroup="cppa:Channel">
        <xs:annotation>
            <xs:documentation>
                <p>A <a href="#TransportChannel">TransportChannel</a> represents a direct implementation of 
                    a <a href="#Channel">Channel</a> using a
                    referenced <a href="#Transport">Transport</a>,  i.e. there is no messaging protocol 
                    providing packaging or 
                    other features on top of the specified transport.  
                </p>
                <p>The <a href="#TransportChannel">TransportChannel</a> is provided to support 
                    the following features:</p>
                <ul>
                    <li>To support payload exchange using REST. In this case a reference MUST be provided using the
                        <em>transport</em> attribute to a <a href="#Transport">Transport</a> that is an HTTP POST.</li>
                    <li>To support the external payload feature, as used in ebMS2 and ebMS3.  In this case there are
                        two <a href="#TransportChannel">TransportChannel</a>s involved:
                        <ol>
                            <li>One <a href="#TransportChannel">TransportChannel</a> that is a back-channel, 
                                used to transport the 
                                payload data. This channel can be bound to an action.</li>
                            <li>A separate <a href="#TransportChannel">TransportChannel</a> that creates 
                                the back-channel. This channel
                                is to be defined separately and is referenced using 
                                using <a href="#RequestChannelId">RequestChannelId</a>.
                            </li>
                        </ol>
                    </li>
                </ul>
                <p>A <a href="#TransportChannel">TransportChannel</a> MUST NOT be linked 
                    to a <a href="#Transport">Transport</a> element using the <em>transport</em> 
                    attribute in case the channel 
                    uses a back-channel created by another channel. That other channel could be:
                </p>
                <ul>
                    <li>The request <a href="#TransportChannel">TransportChannel</a> used by the first leg 
                        in a Two Way exchange
                        that is referenced by a <em>replyTo</em> attribute on the response action that uses
                        the back-channel. The response <a href="#TransportChannel">TransportChannel</a> 
                        MUST have 
                        an <em>asResponse</em> attribute present with a true value.                         
                    </li>
                    <li>An ad hoc <a href="#TransportChannel">TransportChannel</a> that is used purely to 
                        provide the back-channel. 
                        This channel is identified using the <a href="#RequestChannelId">RequestChannelId</a>.
                    </li>
                </ul>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:ChannelType">
                    <xs:sequence>
                        <xs:element ref="cppa:RequestChannelId" minOccurs="0"/>
                    </xs:sequence>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="RequestChannelId" type="xs:IDREF">
        <xs:annotation>
            <xs:documentation>
                <p>A <a href="#RequestChannelId">RequestChannelId</a> identifies a channel that does not 
                    serve to exchange any 
                    payload and is not bound to an action. It provides a backchannel to another channel that 
                    does carry any payload and is bound to an action.
                </p>
                <p>The use of <a href="#RequestChannelId">RequestChannelId</a> is similar to the ebMS3 <a href="#PullRequestId">PullRequestId</a>. The 
                    difference is that the <a href="#PullRequestId">PullRequestId</a> also involves the use 
                    of an ebMS3 envelope
                    containing a Pull signal, whereas a <a href="#RequestChannelId">RequestChannelId</a> 
                    only serves to specify the use of
                    an transport channel request and involves no message protocol specific structures. 
                </p>
                <p>A <a href="#TransportChannel">TransportChannel</a> that is used as a 
                    <a href="#RequestChannelId">RequestChannelId</a> for use in ebMS2 and ebMS3 
                    MUST be bound to an <a href="#HTTPTransport">HTTPTransport</a> that is specified to use the 
                    HTTP GET method.  This is different from all other current uses of
                    channels for use with ebMS2, AS2, ebMS3 and AS4. 
                </p>
                <p>The <em>Address</em> URL that is used in the referenced transport MAY not be the
                    complete URL. It may be that the external payload involves a <em>href</em> that adds
                    a payload specific suffix. 
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- AMQP -->

    <xs:element name="AMQPChannel" substitutionGroup="cppa:Channel" type="cppa:AMQPChannelType">
        <xs:annotation>
            <xs:documentation>
                <p>An <a href="#AMQPChannel">AMQPChannel</a> configures a channel using the OASIS Advanced Message 
                    Queuing Protocol (AMQP) messaging protocol [amqp-core-messaging-v1.0] 
                    which uses the AMQP transport protocols [amqp-core-transport-v1.0].
                    In this CPPA3 schema, 
                    the <a href="#AMQPChannel">AMQPChannel</a> name is used for the element 
                    to indicat that the element is a member of the <a href="#Channel">Channel</a> substitution group, 
                    which in CPPA3 eis used for messaging protocols. 
                    In AMQP Transport, <em>channels</em> relate to a division of 
                    <em>connection</em>s into a negotiated number of independent unidirectional
                    channels [amqp-core-transport-v1.0]. This is a lower-level concept that is not to be confused 
                    with the CPPA3 concept of an <a href="#AMQPChannel">AMQPChannel</a>.
                </p>
                <p>AMQP provides an Application Properties feature to allow routing or filtering of messages.
                    This feature can be used to encode <a href="#Property">Property</a> elements specified
                    at <a href="#ActionBinding">ActionBinding</a> level.  Furthermore, 
                    usage profiles of AMQP for use with CPPA3 MAY use this feature to encode the CPPA3 
                    <em>Service</em> and <em>Action</em> values in AMQP messages. 
                </p>
                <p>The OASIS AMQP Standard defines its own TCP-based transport protocol. A CPPA document that
                    includes one or more <a href="#AMQPChannel">AMQPChannel</a> elements that use the AMQP transport 
                    protocol MUST include one or more <a href="#AMQPTransport">AMQPTransport</a> elements and 
                    reference them using the <em>transport</em> attribute value. Configuration of AMQP transport
                    links bound to AMQP channels reflect the actions bound to the channel.                    
                </p>
                <p>As any CPPA3 <a href="#Channel">Channel</a>, an <a href="#AMQPChannel">AMQPChannel</a> MAY
                    specify a <a href="#MaxSize">MaxSize</a>. In AMQP link attachment, this value MUST be used as as 
                    value for the <em>max-message-size</em> parameter.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="AMQPChannelType">
        <xs:annotation>
            <xs:documentation>
                <p>The type definition of an <a href="#AMQPChannel">AMQPChannel</a> 
                    supports configuration of some parameters used in AMQP performatives
                    and setting the AMQP protocol version.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:ChannelType">
                <xs:sequence> </xs:sequence>
                <xs:attribute name="version" type="cppa:non-empty-string" default="1.0">
                    <xs:annotation>
                        <xs:documentation>
                            <p>The AMQP protocol version supported by the container.  If a party supports
                                multiple AMQP protocol versions, its CPP can bind its actions to multiple distinct 
                                <a href="#AMQPChannel">AMQPChannel</a> elements that have different values
                                for the <em>version</em> attribute, but that listen on the same TCP port.
                                The actual version used is at run-time determined in AMQP version negotiation.
                            </p>
                        </xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- Channel Delegation -->

    <xs:element name="DelegationChannel" substitutionGroup="cppa:Channel"
        type="cppa:DelegationChannelType">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#DelegationChannel">DelegationChannel</a> element 
                    supports the <em>delegation</em> of message processing by parties to third parties that act 
                    on their behalf.   The element MAY be used in 
                    a <a href="#CPP">CPP</a> or <a href="#CPA">CPA</a>.
                </p>
                <p>The legal meaning and implicationsof the use of messaging delegation are out of scope for this 
                    specification. </p>
                <p>If a <a href="#DelegationChannel">DelegationChannel</a> is used in a <a href="#CPP">CPP</a>, that 
                    <a href="#CPP">CPP</a> is called the delegation <em>source</em> <a href="#CPP">CPP</a>. 
                    A <a href="#DelegationChannel">DelegationChannel</a> in a source 
                    <a href="#CPP">CPP</a> MUST specify a target 
                    a <a href="#PartyId">PartyId</a>. It MAY also target a specific <a href="#ProfileIdentifier">ProfileIdentifier</a> that identifies a specific
                    <a href="#CPP">CPP</a> for the Party identified using <a href="#PartyId">PartyId</a>. 
                    
                    The <a href="#CPP">CPP</a> for the target <a href="#PartyId">PartyId</a> is 
                    the delegation target <a href="#CPP">CPP</a>. 
                    
                    If a <a href="#ProfileIdentifier">ProfileIdentifier</a> is not explicitly 
                    specified in the source <a href="#CPP">CPP</a>, the reference target <a href="#CPP">CPP</a> 
                    MAY available as contextual information. 
                    Mechanisms for making that contextual 
                    information available to CPPA3 processing are out of scope for this specification.
                    Note that any reference is unambiguous if there is only one known 
                    <a href="#CPP">CPP</a> for the target <a href="#PartyId">PartyId</a>. 
                    Criteria for handling ambiguity, if there are multiple <a href="#CPP">CPP</a>s for the 
                    target <a href="#PartyId">PartyId</a>, are out of scope for this specification.
                </p>
                <p>If, in a source 
                    <a href="#CPP">CPP</a> for
                    a Party P1, there is an 
                    <a href="#ActionBinding">ActionBinding</a>
                    that binds an <em>Action</em> in a <a href="#ServiceBinding">ServiceBinding</a> to a 
                    target <a href="#CPP">CPP</a> for a Party P3, then that
                    target <a href="#CPP">CPP</a> MUST define an <a href="#ActionBinding">ActionBinding</a> 
                    that has the same value for 
                    <em>name</em> and <em>sendOrReceive</em> 
                    in a <a href="#ServiceBinding">ServiceBinding</a> that has the same value for 
                    the <a href="#Service">Service</a> 
                    element as the source <a href="#Service">Service</a>. The values for any ebBP attributes in 
                    the source and CPPs MUST also match. The source CPP is invalid if these requirements is not met.     
                </p>
                <p>In a valid source <a href="#CPP">CPP</a> for a Party P1, a 
                    <a href="#DelegationChannel">DelegationChannel</a> element targeting a <a href="#CPP">CPP</a> for a Party P3 
                    expresses that P3 MAY act as delegated Sender (if the value 
                    of the <em>sendOrReceive</em> attribute of the <a href="#ActionBinding">ActionBinding</a> 
                    is <em>send</em>) or Receiver (if the value is <em>receive</em>) for the P1 action. 
                    Note that an <a href="#ActionBinding">ActionBinding</a> in 
                    the target <a href="#CPP">CPP</a> MAY provide more than one alternative <a href="#Channel">Channel</a> 
                    for the action. The delegation feature decouples the channel binding for the 
                    target <a href="#PartyId">PartyId</a>
                    from the delegating Party.
                </p>

                <p>As CPPA3 <a href="#Channel">Channel</a>s are bound to individual actions in services using 
                    <a href="#ActionBinding">ActionBinding</a>s, 
                    Parties MAY use delegation channels for some communication but not for others. For example, a 
                    Party MAY outsource
                    a specific <a href="#Service">Service</a> to a particular service provider that operates its own 
                    messaging endpoint, distinct and separate from Party's endpoint. The Party 
                    MAY outsource other <a href="#Service">Service</a>s to other Parties and operate its own 
                    messaging endpoint for other communication.
                </p>
                
                <p>In a <a href="#CPA">CPA</a>, a <a href="#DelegationChannel">DelegationChannel</a> MUST include
                    a <a href="#PartyId">PartyId</a> or a <a href="#CounterPartyId">CounterPartyId</a> element. 
                    
                    A
                    <a href="#PartyId">PartyId</a> expresses a delegation from the Party identified in the 
                    <a href="#PartyInfo">PartyInfo</a> element. If followed by a 
                    <a href="#ProfileIdentifier">ProfileIdentifier</a> element, this element identifies a  
                    <a href="#CPP">CPP</a> for the referenced <a href="#PartyId">PartyId</a>.
                    
                    A <a href="#PartyId">CounterPartyId</a> expresses a delegation from the Party identified in the 
                    <a href="#CounterPartyInfo">CounterPartyInfo</a> element. If followed by a 
                    <a href="#ProfileIdentifier">ProfileIdentifier</a> element, this element identifies a  
                    a <a href="#CPP">CPP</a> for the referenced <a href="#CounterPartyId">CounterPartyId</a>.
                    
                    A <a href="#DelegationChannel">DelegationChannel</a> in a 
                    <a href="#CPA">CPA</a> MAY include both a <a href="#PartyId">PartyId</a> and a 
                    <a href="#CounterPartyId">CounterPartyId</a> element. This expresses delegations from both Parties in
                    the <a href="#CPA">CPA</a>.  Note that it is possible that both Parties delegate to the 
                    same third Party.
                </p>
                <p> 
                    When using <em>delegation</em>, the delegated Party acts as Sender or Receiver for 
                    messages for the delegating Party using its own identifier. 
                    This is different from <em>impersonation</em>, where the third party uses the impersonated Party's 
                    identifier. 
                    The difference can be seen when used with protocols like ebMS2, 
                    ebMS3 and EDIINT:</p>
                <ul>
                    <li>In case of <em>delegation</em>, the third party that acts 
                        as Sender or Receiver is identified in the message headers identifying Sender or Receiver party. 
                        The third party uses its own X.509 or other security tokens to secure communication.</li>
                    <li>In case of <em>impersonation</em>, the third party is anonymous or even not noticeable. 
                        Its messaging software processes messages using the impersonated Party's identifier and 
                        MAY even use a security token linked to the impersonated Party. </li>
                </ul>
                <p>If third Parties exchange messages on behalf of other Parties, the relation of those messages to the 
                    Parties on whose behalf the third party operate is to be encoded in different ways, e.g. at the 
                    payload content level (for example using the UN/CEFACT Standard Business Document Header [SBDH]) 
                    or (for protocols that support it,  like ebMS3 and AS4), using message properties.   
                </p>
                <p>The CPPA3 delegation features supports <em>authorization</em> and <em>routing</em>:</p>
                <ul>
                    <li>A Party P2 that receives messages from a third Party P3 that suggests it acts on behalf of another 
                        Party P1   
                        SHOULD use delegation information in relevant <a href="#CPP">CPP</a>s or <a href="#CPA">CPA</a>s as 
                        information to determine whether this P3 is in fact <em>authorized</em> to send on 
                        behalf of P1.</li>
                    <li>A Party P1 that intends to sends data to a Party P2 SHOULD use the delegation information 
                        in relevant <a href="#CPP">CPP</a>s or <a href="#CPA">CPA</a>s to determine if the message 
                        is instead expected to be sent to a third Party P3 that P2 delegates messaging receiving to.</li>
                </ul>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="DelegationChannelType">
        <xs:complexContent>
            <xs:extension base="cppa:ChannelType">
                <xs:sequence>
                    <xs:sequence minOccurs="0">
                        <xs:element ref="cppa:PartyId"/>
                        <xs:element ref="cppa:ProfileIdentifier" minOccurs="0"/>
                    </xs:sequence>
                    <xs:sequence minOccurs="0">
                        <xs:element ref="cppa:CounterPartyId"/>
                        <xs:element ref="cppa:ProfileIdentifier" minOccurs="0"/>
                    </xs:sequence>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="CounterPartyId" type="cppa:PartyIdType">
        <xs:annotation>
            <xs:documentation>
                <p>A <a href="#CounterPartyId">CounterPartyId</a> element MAY be used in a <a href="#DelegationChannel">DelegationChannel</a> in a <a href="#CPA">CPA</a>. 
                    It identifies the third Party to which the Party identified in the 
                    <a href="#CounterPartyInfo">CounterPartyInfo</a> element delegates message processing. </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- Transport -->

    <xs:element name="Transport" type="cppa:TransportType" abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>An abstract element to configure a transport.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="TransportType" abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>This is an abstract type that can be substituted to cover particular transport protocols. </p>
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="cppa:Description" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:ID" use="required"/>
    </xs:complexType>

    <xs:element name="TCPTransport" type="cppa:TCPTransportType" substitutionGroup="cppa:Transport"
        abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>An abstract element to represent transport protocols based on 
                    Transmission Control Protocol (TCP), such as HTTP, SMTP and FTP.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="TCPTransportType">
        <xs:annotation>
            <xs:documentation>
                <p>An abstract type to represent configuration information 
                    common to TCP-based transport protocols.</p>
                <p>If the attribute <em>supportsIPv4</em> is present with a false value, then the
                    elements <a href="#ClientIPv4">ClientIPv4</a> and 
                    <a href="#ServerIPv4">ServerIPv4</a> MUST NOT be present.  
                </p>
                <p>If the attribute <em>supportsIPv6</em> is present with a false value, then the
                    elements <a href="#ClientIPv6">ClientIPv6</a> and 
                    <a href="#ServerIPv6">ServerIPv6</a> MUST NOT be present.  
                </p>
                <p>If the server supports IPv4, and DNS is used for endpoint resolution, 
                    then any domains named in the
                    <a href="#Endpoint">Endpoint</a> element MUST be discoverable using 
                    DNS A records.</p>
                <p>If the server supports IPv6, and DNS is used for endpoint resolution, 
                    then any domains named in the
                    <a href="#Endpoint">Endpoint</a> element MUST be discoverable using 
                    DNS AAAA records.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:TransportType">
                <xs:sequence>
                    <xs:element ref="cppa:ClientIPv4" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="cppa:ClientIPv6" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="cppa:ServerIPv4" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="cppa:ServerIPv6" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="cppa:Endpoint" minOccurs="0"/>
                    <xs:element ref="cppa:TransportLayerSecurity" minOccurs="0"/>
                    <xs:element ref="cppa:UserAuthentication" minOccurs="0"/>
                    <xs:element ref="cppa:TransportRestart" minOccurs="0"/>
                    <xs:any namespace="##other" processContents="lax" minOccurs="0"
                        maxOccurs="unbounded"/>
                </xs:sequence>
                <xs:attribute name="supportsIPv4" type="xs:boolean">
                    <xs:annotation>
                        <xs:documentation>Indicates support for IPv4. Its absence is equivalent to presence with a true value.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
                <xs:attribute name="supportsIPv6" type="xs:boolean">
                    <xs:annotation>
                        <xs:documentation>Indicates support for IPv6. Its absence is equivalent to presence with a true value.</xs:documentation>
                    </xs:annotation>
                </xs:attribute>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="HTTPTransport" substitutionGroup="cppa:TCPTransport">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies a transport using the Hypertext Transfer Protocol (HTTP) 
                    application protocol. It covers both HTTP 1.1 [RFC7230] and HTTP/2 [RFC7540].</p>
                <p>Note that HTTP/2 enables using a single origin connection for any server. 
                    This means that exchanges using <a href="#Channel">Channel</a>s that are bound to 
                    HTTP/2 transports SHOULD initiate new <em>streams</em>s on the existing HTTP/2 
                    connection, if such an existing connection is available. 
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:TCPTransportType">
                    <xs:sequence>
                        <xs:element name="HTTPVersion" minOccurs="0" maxOccurs="unbounded">
                            <xs:simpleType>
                                <xs:union>
                                    <xs:simpleType>
                                        <xs:restriction base="xs:token">
                                            <xs:enumeration value="1.1"/>
                                            <xs:enumeration value="2.0"/>
                                        </xs:restriction>
                                    </xs:simpleType>
                                    <xs:simpleType>
                                        <xs:annotation>
                                            <xs:documentation>Escape for use with any future 
                                                post 2.0 protocol.</xs:documentation>
                                        </xs:annotation>
                                        <xs:restriction base="xs:string">
                                            <xs:minLength value="1"/>
                                        </xs:restriction>
                                    </xs:simpleType>
                                </xs:union>
                            </xs:simpleType>
                        </xs:element>
                        <xs:element ref="cppa:ChunkedTransferCoding" minOccurs="0"/>
                        <xs:element ref="cppa:ContentCoding" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="cppa:Pipelining" minOccurs="0"/>
                    </xs:sequence>
                    <xs:attribute name="method" default="POST">
                        <xs:simpleType>
                            <xs:restriction base="xs:token">
                                <xs:enumeration value="POST"/>
                                <xs:enumeration value="GET"/>
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:attribute>
                </xs:extension>

            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="ChunkedTransferCoding" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>This element specificies if <em>chunked</em> Transfer Coding is 
                    used for the transport. 
                    Chunking is an HTTP 1.1 feature, specified in [RFC7230], section 4.1.   
                    It MUST NOT be used when configuring an HTTP 2.0 transport [RFC7540].
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ContentCoding" type="xs:token">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies a Content Coding that MAY be used for the transport. </p>
                <p>The content of the element MUST be a valid Content Coding parameter, the values of
                    which are specified in the IANA Content Coding Registry [IANA-HTTP].
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="Pipelining" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>This element specificies use of an HTTP 1.1 feature in which multiple requests using the 
                    transpors MAY be pipelined. The element MUST NOT be used with HTTP/2.
                </p>
                <p>Absence of the element is equivalent to it being present with a <em>false</em> value.</p>
                <p>Of the messaging protocols covered in this version of CPPA3, only [EBMS3PART2], sections 6.3.1 and 
                    6.3.2, specifies a use of HTTP pipelining.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="SMTPTransport" substitutionGroup="cppa:TCPTransport">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#SMTPTransport">SMTPTransport</a> element defines a transport using the (SMTP) 
                    application protocol [RFC5321]. It
                    can be used with e.g. ebMS2, ebMS3 (but not AS4) or for AS1.</p>
                <p>Additional configuration elements for SMTP are the following:</p>
                <ol>
                    <li>The <em>From</em> element can be used to configure a value for the 
                        SMTP <em>From</em> header.</li>
                    <li>The <em>To</em> element can be used to configure a value for 
                        the SMTP <em>To</em> header.</li>
                    <li>The <em>Subject</em> element can be used to configure a value for 
                        the SMTP <em>Subject</em> header.</li>
                </ol>
                <p>When using SMTP, transport data is restricted to 7bit US-ASCII with lines no longer than 
                    1000 characters including any trailing CRLF line separator, the encoding rules of section 6 
                    of RFC 2045 apply, meaning application of appropriate <em>content-transfer-encoding</em>. </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:TCPTransportType">
                    <xs:sequence>
                        <xs:element name="From" type="cppa:non-empty-string" minOccurs="0"/>
                        <xs:element name="To" type="cppa:non-empty-string" minOccurs="0"/>
                        <xs:element name="Subject" type="cppa:non-empty-string" minOccurs="0"/>
                    </xs:sequence>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="FTPTransport" substitutionGroup="cppa:TCPTransport">
        <xs:annotation>
            <xs:documentation>
                <p>Transport using the File Transfer Protocol [RFC0959].</p>
                <p>The <em>method</em> attribute MAY be set to either <em>PUT</em> or <em>GET</em>,
                    correspondonding to sender-initiated or receiver-oriented transfer, 
                    respectively, and reflecting the FTP command to be used. 
                    Absence of the attribute is equivalent to presence with the
                    value <em>PUT</em>.
                </p>
                <p>When used with <em>PUT</em> transfer, the <em>receiver</em> party is 
                    expected to provide the server-related sub-elements. When used with <em>GET</em>, 
                    these elements are expected to be provided by the sender.
                </p>
                <p>To specify use of TLS, users MUST provide a <a 
                    href="#TransportLayerSecurity">TransportLayerSecurity</a> subelement. 
                    The reason is that no 
                    official IANA <em>ftps</em> scheme exists, unlike <em>https</em> which refers to 
                    TLS-secured HTTP. In practice, many networking software implementations 
                    understand the <em>ftps</em> URI scheme as referring to TLS-secured file 
                    transfer. 
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:TCPTransportType">
                    <xs:attribute name="method" default="PUT">
                        <xs:simpleType>
                            <xs:restriction base="xs:token">
                                <xs:enumeration value="PUT"/>
                                <xs:enumeration value="GET"/>
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:attribute>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="SFTPTransport" substitutionGroup="cppa:TCPTransport">
        <xs:annotation>
            <xs:documentation>
                <p>Transport using the SSH File Transfer Protocol (SFTP) subsystem of the 
                    Secure Shell (SSH) Connection Protocol [RFC4254]. As for the 
                    <a href="#FTPTransport">FTPTransport</a>, the <em>method</em>
                    attribute can be used to indicate the direction of transfer and the
                    commands to be used.
                </p>
                <p>This transport MUST not be used with a <a 
                    href="#TransportLayerSecurity">TransportLayerSecurity</a> subelement,
                    as SSH2 provides security natively.
                </p>
                <p>To configure use of compression, a <a href="#Compression">Compression</a> 
                    element MUST be provided. The only algorithm currently supported in SSH2
                    is <em>application/gzip</em>.
                </p>
                <p>To specify use of particular SSH public keys, a <a href="#SSHClientKeyRef">SSHClientKeyRef</a> (for
                    client authentication) or a <a href="#SSHServerKeyRef">SSHServerKeyRef</a> (for server 
                    authentication) MUST be used. 
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:TCPTransportType">
                    <xs:sequence>
                        <xs:element ref="cppa:Compression" minOccurs="0"/>
                        <xs:element ref="cppa:SSHClientKeyRef" minOccurs="0" />
                        <xs:element ref="cppa:SSHServerKeyRef" minOccurs="0" />
                        <xs:element ref="cppa:EncryptionAlgorithm" minOccurs="0" maxOccurs="unbounded" />
                        <xs:element ref="cppa:SSHCipher" minOccurs="0" maxOccurs="unbounded" />
                    </xs:sequence>
                    <xs:attribute name="method" default="PUT">
                        <xs:simpleType>
                            <xs:restriction base="xs:token">
                                <xs:enumeration value="PUT"/>
                                <xs:enumeration value="GET"/>
                            </xs:restriction>
                        </xs:simpleType>
                    </xs:attribute>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="SSHCipher" type="cppa:non-empty-string">
        <xs:annotation>
            <xs:documentation>
                <p>An SSH cipher that MAY be used for the SSH connection using the 
                    notation used in the SSH specifications.  For example, 
                    <em>aes256-gcm@openssh.com</em>.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>
    

    <xs:element name="WSTransport" substitutionGroup="cppa:TCPTransport">
        <xs:annotation>
            <xs:documentation>
                <p>Transport using the Web Socket Protocol [RFC6455].
                    Since Web Socket is a bidirectional protocol, either sender or 
                    receiver can provide the initial endpoint to be used to set up 
                    the Web Socket Transport between two parties. Note that
                    Web Socket connections are persistent and can be reused for 
                    multiple transfers, in either direction. 
                </p>
                <p>To specify use of TLS, users MUST provide a <a href="#TransportLayerSecurity">TransportLayerSecurity</a> subelement,
                    and use the <em>wss</em> scheme in the endpoint 
                    address.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:complexContent>
                <xs:extension base="cppa:TCPTransportType">
                    <xs:sequence>
                        <xs:element name="SubProtocol" type="cppa:non-empty-string" minOccurs="0"
                            maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:extension>
            </xs:complexContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="AMQPTransport" substitutionGroup="cppa:TCPTransport"
        type="cppa:AMQPTransportType">
        <xs:annotation>
            <xs:documentation>
                <p>Transport using the native TCP transport mode defined in the 
                    AMQP Transport protocol [amqp-core-transport-v1.0]. 
                </p>
                <p>In a <a href="#CPP">CPP</a>, 
                    if an <a href="#ActionBinding">ActionBinding</a> binds an sending action in a service 
                    to an <a href="#AMQPChannel">AMQPChannel</a> that uses an 
                    <a href="#AMQPTransport">AMQPTransport</a>, then the AMQP transport is a potential AMQP link 
                    <em>source</em>  
                    for the party. If the binding is of a receiving action, then the channel is a potential 
                    AMQP link <em>target</em> for the party.</p>
                <p>In a <a href="#CPA">CPA</a>, an <a href="#ActionBinding">ActionBinding</a> that is bound to 
                    an <a href="#AMQPChannel">AMQPChannel</a> that uses an 
                    <a href="#AMQPTransport">AMQPTransport</a> configures a link to be used to  
                    exchange data using AMQP messaging from the sender party as link <em>source</em> to the receiver party
                    as link <em>target</em>.
                </p>
                <p>In AMQP, links are named so that they can be recovered when communication is interrupted. 
                    AMQP link names MUST uniquely identify the link amongst all links of the same direction between the 
                    two participating containers.
                    It is RECOMMENDED to adopt a consistent naming convention for link names.
                    As an <a href="#AgreementIdentifier">AgreementIdentifier</a> value is 
                    unique and shared between two parties, and the value of the <em>id</em> attribute 
                    of an <a href="#ActionBinding">ActionBinding</a>
                    element is unique within a CPA, it is RECOMMENDED to use the concatenation of these two 
                    values, using the <em>#</em> character as separator, to name the AMQP link.                    
                </p>
                <p>In AMQP, links are attached to sessions, which begin on channels on connections..
                    Full specification of 
                    the details of the mapping of CPPA3 elements to these AMQP constructs 
                    is out of scope for this specification.  However, it is RECOMMENDED that 
                    <a href="#ActionBinding">ActionBinding</a>s in a <a href="#CPA">CPA</a> that use the same <a href="#AMQPChannel">AMQPChannel</a> reuse a single AMQP session.    
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>


    <xs:complexType name="AMQPTransportType">
        <xs:annotation>
            <xs:documentation>
                <p>To specify use of TLS as a pure TLS tunnel through which the standard AMQP protocol flows, 
                    users MUST provide a <a href="#TransportLayerSecurity">TransportLayerSecurity</a> subelement. This is called 
                    the <em>alternative establishment</em> in section 5.2.1 of [amqp-core-transport-v1.0]. 
                </p>
                <p>In a <a href="#CPP">CPP</a>, one or multiple <a href="#SenderSettleMode">SenderSettleMode</a>
                    and one or <a href="#ReceiverSettleMode">ReceiverSettleMode</a> elements MAY be present.
                    These elements encode the sender or receiver settle modes that the AMQP transport MAY 
                    deploy.  In a <a href="#CPA">CPA</a>, at most one of either type of elements MAY be 
                    present, reflecting the mode that the transport MUST deploy. Absence of any of the 
                    two elements means the default specified in [amqp-core-transport-v1.0] apply.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:TCPTransportType">
                <xs:sequence>
                    <!-- connection configuration -->
                    <xs:element ref="cppa:MaxFrameSize" minOccurs="0"/>
                    <xs:element ref="cppa:ChannelMax" minOccurs="0"/>
                    <xs:element ref="cppa:IdleTimeOut" minOccurs="0"/>
                    <xs:element ref="cppa:ConnectionProperties" minOccurs="0"/>
                    <!-- session configuration -->
                    <xs:element ref="cppa:SessionProperties" minOccurs="0"/>
                    <!-- link configuration -->
                    <xs:element ref="cppa:SenderSettleMode" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="cppa:ReceiverSettleMode" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="cppa:LinkProperties" minOccurs="0"/>
                    <!-- security configuration -->
                    <xs:element ref="cppa:AMQPSecurity" minOccurs="0"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="AMQPSecurity">
        <xs:annotation>
            <xs:documentation>
                <p>AMQP messaging is secured using Simple Authentication and Security Layer (SASL) mechanism
                    [RFC4422].  AMQP clients and servers negotiate a security mechanism in the SASL handshake. 
                    CPPA3 allows parties to express and negotiate supported mechanisms. As with TLS, CPPA3
                    negotiation does not replace the protocol handshaking. Rather, it provides an ahead of time
                    compatibility check.
                </p>
                <p>If the sending peer does not require its partner to authenticate with it, then 
                    it SHOULD send a list of one element with its value as the SASL mechanism <em>ANONYMOUS</em>.</p>
                <p>To specify the use of TLSs as an in-place upgrade, in which case the transition to TLS occurs 
                    after the AMQP protocol handshake, users MUST provide a <a href="#TransportLayerSecurity">TransportLayerSecurity</a> subelement. </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element name="SASLMechanism" type="cppa:non-empty-string" minOccurs="1"
                    maxOccurs="unbounded"/>
                <xs:element ref="cppa:TransportLayerSecurity" minOccurs="0" maxOccurs="1"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="MaxFrameSize" type="xs:positiveInteger">
        <xs:annotation>
            <xs:documentation>
                <p>The <em>max-frame-size</em> parameter as defined in 
                    section 2.7.1 of [amqp-core-transport-v1.0] expresses a proposed maximum frame size</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ChannelMax" type="xs:positiveInteger">
        <xs:annotation>
            <xs:documentation>
                <p>The <em>channel-max</em> parameter as defined in 
                    section 2.7.1 of [amqp-core-transport-v1.0] expresses the maximum channel number that 
                    can be used on the connection</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="IdleTimeOut" type="xs:positiveInteger">
        <xs:annotation>
            <xs:documentation>
                <p>The <em>idle-time-out</em> parameter as defined in 
                    section 2.7.1 of [amqp-core-transport-v1.0] expresses the maximum channel number that can 
                    be used on the connection</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ConnectionProperties" type="cppa:PropertySetType">
        <xs:annotation>
            <xs:documentation>
                <p>The <em>ConnectionProperties</em> element allows configuration of
                    connection properties as defined in section 2.7.1 of [amqp-core-transport-v1.0].
                </p>
            </xs:documentation>
        </xs:annotation>

    </xs:element>

    <xs:element name="SessionProperties" type="cppa:PropertySetType">
        <xs:annotation>
            <xs:documentation>
                <p>The <em>SessionProperties</em> element allows configuration of
                    connection properties as defined in section 2.7.2 of [amqp-core-transport-v1.0].
                </p>
            </xs:documentation>
        </xs:annotation>

    </xs:element>

    <xs:element name="SenderSettleMode">
        <xs:annotation>
            <xs:documentation>Sender Settle Mode as defined in 2.8.2 of [amqp-core-transport-v1.0]</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:enumeration value="unsettled"/>
                <xs:enumeration value="settled"/>
                <xs:enumeration value="mixed"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>

    <xs:element name="ReceiverSettleMode">
        <xs:annotation>
            <xs:documentation>Receiver Settle Mode as defined in 2.8.3 of [amqp-core-transport-v1.0]</xs:documentation>
        </xs:annotation>
        <xs:simpleType>
            <xs:restriction base="xs:string">
                <xs:enumeration value="first"/>
                <xs:enumeration value="second"/>
            </xs:restriction>
        </xs:simpleType>
    </xs:element>

    <xs:element name="LinkProperties" type="cppa:PropertySetType">
        <xs:annotation>
            <xs:documentation>
                <p>The <em>LinkProperties</em> element allows configuration of
                    connection properties as defined in section 2.7.3 of [amqp-core-transport-v1.0].
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>


    <!-- Networking -->

    <xs:element name="ClientIPv4">
        <xs:annotation>
            <xs:documentation>
                <p>This element defines an IP address (belonging to the IPv4 address family) 
                    or address range which the client MAY use for the transport.</p>
                <p>An address range can be specified using common notations such as
                    the <em>*</em> wildcard character, the <em>-</em> separator and the CIDR
                    <em>/n</em> syntax to select the number of matching bits.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="cppa:non-empty-string"/>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>


    <xs:element name="ClientIPv6">
        <xs:annotation>
            <xs:documentation>
                <p>This element defines an IPv6 address literal or address range 
                    which the client MAY use for the transport.</p>
                <p>An address range can be specified using common notations such as
                    the <em>*</em> wildcard character, the <em>-</em> separator and the CIDR
                    <em>/n</em> syntax to select the number of matching bits.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="cppa:non-empty-string"/>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="ServerIPv4">
        <xs:annotation>
            <xs:documentation>
                <p>This element defines an IP address (belonging to the IPv4 address family) which 
                    the server MAY use for the transport.
                    If present, when using IPv4 and DNS, an Internet name used in the <a href="#Endpoint">Endpoint</a> 
                    MUST be published as a DNS A record. 
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="cppa:non-empty-string"/>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

    <xs:element name="ServerIPv6">
        <xs:annotation>
            <xs:documentation>
                <p>This element defines an IPv6 address literal which the server MAY use for the transport.
                    If present, when using IPv6 and DNS, an Internet name used in the <a href="#Endpoint">Endpoint</a> 
                    MUST be published as a DNS AAAA record. 
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="cppa:non-empty-string"/>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>


    <xs:element name="Endpoint" type="xs:anyURI">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies a URI value that MUST be used as endpoint address.</p>
                <p>In ebMS3, this corresponds to the <em>PMode[1].Protocol.Address</em> parameter.</p>                
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- TLS -->

    <xs:element name="TransportLayerSecurity">
        <xs:annotation>
            <xs:documentation>
                <p>This elements specifies use of configuration for Transport Layer Security.  Note that, while 
                    some URI schemes like <em>https</em> already imply use of a TLS protocol, this is 
                    not the case for other schemes, such as <em>ftp</em>.  Therefore, the element is
                    REQUIRED in all situations where use of TLS is expected. Subelements of the 
                    element can be used to further configure how the TLS protocol is used.
                </p>
                <p>If one or more <a href="#ClientCertificatePolicySetRef">ClientCertificatePolicySetRef</a> elements
                    is present, Policy Certification Authority certificates and the issuing Certificate Authority 
                    certificate in the client certificate chain MUST contain a <em>certificatePolicies</em> 
                    X.509 extension, the values of which MUST be within the set of referenced policies.
                </p>
                <p>If one or more <a href="#ServerCertificatePolicySetRef">ServerCertificatePolicySetRef</a> elements
                    is present, Policy Certification Authority certificates and the issuing Certificate Authority 
                    certificate in the server certificate chain MUST contain a <em>certificatePolicies</em> 
                    X.509 extension, the values of which MUST be within the set of referenced policies.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:StartTLS" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="cppa:TLSProtocol" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:ServerNameIndicationRequired" minOccurs="0" maxOccurs="1"/>
                <xs:element ref="cppa:CipherSuite" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:ClientCertificateRef" minOccurs="0"/>
                <xs:element ref="cppa:ClientCertificateRequired" minOccurs="0"/>
                <xs:element ref="cppa:ClientTrustAnchorSetRef" minOccurs="0"/>
                <xs:element ref="cppa:ClientCertificatePolicySetRef" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:ServerCertificateRef" minOccurs="0"/>
                <xs:element ref="cppa:ServerCertificateRequired" minOccurs="0"/>
                <xs:element ref="cppa:ServerTrustAnchorSetRef" minOccurs="0"/>
                <xs:element ref="cppa:ServerCertificatePolicySetRef" minOccurs="0"
                    maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    
    <xs:element name="StartTLS" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>This element can be used to indicate the ability to use an extension to use 
                    of plain text communication protocols, which offers a way to upgrade a plain text 
                    connection to an encrypted TLS connection instead of using a separate port for 
                    encrypted communication. </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="TLSProtocol">
        <xs:annotation>
            <xs:documentation>
                <p>The element configures the protocol to be used for
                    <a href="#TransportLayerSecurity">TransportLayerSecurity</a>.
                </p>
                <p>If not present, this element is to be interpreted as being present 
                    with the value <em>TLS</em>.</p>
                <p>When used with secure <a href="Transport">Transport</a> elements used for
                    <a href="#ebMS3Channel">ebMS3Channel</a> elements, this element corresponds to 
                    the <em>Pmode[1].Protocol.Security.Protocol</em> 
                    parameter defined in ebMS3 Part 2 and 
                    the attribute <em>version</em> corresponds to the 
                    <em>Pmode[1].Protocol.Security.ProtocolVersion</em> parameter.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="cppa:TLSProtocolType">
                    <xs:attribute name="version" type="cppa:TLSProtocolVersionType">
                        <xs:annotation>
                            <xs:documentation>
                                <p>This attribute defines the version of the Transport Layer Security protocol.</p>
                            </xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

    <xs:simpleType name="TLSProtocolType">
        <xs:annotation>
            <xs:documentation>At the time of writing, for security reasons, SSL 2.0 and 3.0 
                MUST NOT be used.</xs:documentation>
        </xs:annotation>
        <xs:union>
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="TLS"/>
                </xs:restriction>
            </xs:simpleType>
            <xs:simpleType>
                <xs:annotation>
                    <xs:documentation>Escape for use with any future post TLS protocol.</xs:documentation>
                </xs:annotation>
                <xs:restriction base="xs:string">
                    <xs:minLength value="1"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:union>
    </xs:simpleType>

    <xs:simpleType name="TLSProtocolVersionType">
        <xs:annotation>
            <xs:documentation>At the time of writing, for security reasons, TLS 1.0 and 1.1 
                SHOULD NOT be used.</xs:documentation>
        </xs:annotation>
        <xs:union>
            <xs:simpleType>
                <xs:restriction base="xs:token">
                    <xs:enumeration value="1.0"/>
                    <xs:enumeration value="1.1"/>
                    <xs:enumeration value="1.2"/>
                    <xs:enumeration value="1.3"/>
                </xs:restriction>
            </xs:simpleType>
            <xs:simpleType>
                <xs:annotation>
                    <xs:documentation>Escape for use with any future post 1.3 TLS version.</xs:documentation>
                </xs:annotation>
                <xs:restriction base="xs:string">
                    <xs:minLength value="1"/>
                </xs:restriction>
            </xs:simpleType>
        </xs:union>
    </xs:simpleType>

    <xs:element name="ServerNameIndicationRequired" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>This element can be used by the server to indicate that the client MUST
                    implement the TLS Server Name Indication feature [RFC6066].  This would be
                    the case if the server hosts multiple 'virtual' servers at a single 
                    underlying network address and needs to know which one the client intends
                    to connect to.
                </p>
                <p>Note that this feature is only available in TLS version from TLS 1.2.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>
    
    


    <xs:element name="CipherSuite" type="cppa:non-empty-string">
        <xs:annotation>
            <xs:documentation>
                <p>A TLS cipher suite that may be used for the TLS connection using the 
                    alphanumeric notation used in the TLS specifications.  For example, 
                    <em>TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256</em>.
                </p>
                <p>In ebMS3 Part 2, a corresponding parameter called 
                    <em>Pmode[1].Protocol.Security.SecurityAlgorithm</em> is defined.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ClientCertificateRef" type="cppa:CertificateRefType">
        <xs:annotation>
            <xs:documentation>
                <p>A reference to a leaf certificate that MUST be used for TLS client authentication.</p>
                <p>In ebMS3 Part 2, a corresponding parameter called 
                    <em>Pmode[1].Protocol.Security.Client.Certificate</em> is defined</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ClientCertificateRequired" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>In a CPP, this element can be used in a 
                    <a href="#TransportLayerSecurity">TransportLayerSecurity</a> element by a server party 
                    to indicate whether a leaf 
                    signing certificate is to be provided by the client party in the 
                    corresponding element in its CPP. If present with a true value in a CPP context for a 
                    receiver channel, a valid <a href="#ClientCertificateRef">ClientCertificateRef</a> element 
                    MUST be present in the CPP of the sending party for the channel. This referenced 
                    certificate MUST be included for specified CPA transport in a CPA derived from these
                    CPPs.  Client authentication is REQUIRED to use the agreed transport.  
                </p>
                <p>This element MUST NOT be used in a CPA. If specified in a CPP for the 
                    clien party  for the transport, its value is ignored in unification.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>



    <xs:element name="ClientTrustAnchorSetRef" type="cppa:CertificateRefType"
        substitutionGroup="cppa:CertificateRef">
        <xs:annotation>
            <xs:documentation>
                <p>A reference to a trust anchor containing a set of Certificate Authorities 
                    that a client certificate MUST chain to.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ClientCertificatePolicySetRef" type="cppa:CertificatePolicySetReferenceType">
        <xs:annotation>
            <xs:documentation>A reference to an X.509 certificate policy set to be used for a 
                client certificate.</xs:documentation>
        </xs:annotation>
    </xs:element>


    <xs:element name="ServerCertificateRef" type="cppa:CertificateRefType">
        <xs:annotation>
            <xs:documentation>
                <p>A reference to a leaf certificate that MUST used for TLS server authentication.</p>
                <p>In ebMS3 Part 2, a corresponding parameter called 
                    <em>Pmode[1].Protocol.Security.Server.Certificate</em> is defined</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ServerCertificateRequired" type="xs:boolean">
        <xs:annotation>
            <xs:documentation>
                <p>In a CPP, this element can be used in a 
                    <a href="#TransportLayerSecurity">TransportLayerSecurity</a> element by a client party 
                    to indicate whether a leaf 
                    signing certificate is to be provided by the server party in the 
                    corresponding element in its CPP. If present with a true value in a CPP context for a 
                    receiver channel, a valid <a href="#ServerCertificateRef">ServerCertificateRef</a> element 
                    MUST be present in the CPP of the server party for the channel. This referenced 
                    certificate MUST be included for specified CPA transport in a CPA derived from these
                    CPPs.  Server authentication is REQUIRED to use the agreed transport.  
                </p>
                <p>This element MUST NOT be used in a CPA. If specified in a CPP for the 
                    clien party  for the transport, its value is ignored in unification.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>


    <xs:element name="ServerTrustAnchorSetRef" type="cppa:CertificateRefType"
        substitutionGroup="cppa:CertificateRef">
        <xs:annotation>
            <xs:documentation>
                <p>A reference to a trust anchor containing a set of Certificate Authorities 
                    that a server certificate MUST chain to.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="ServerCertificatePolicySetRef" type="cppa:CertificatePolicySetReferenceType">
        <xs:annotation>
            <xs:documentation>A reference to an X.509 certificate policy set to be used for a 
                server certificate.</xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="TransportRestart">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#TransportRestart">TransportRestart</a> element specifies and configures 
                    the use of a restart protocol. 
                    A restart transport protocol allows clients to check if previous partial transmissions exist and 
                    (if so) resume from the last known position in the data stream.  </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:RestartProtocol"/>
                <xs:element ref="cppa:RestartInterval" minOccurs="0"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>

    <xs:element name="RestartProtocol" type="xs:token">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies a specific sub-protocol for transport protocol restarts. 
                </p>
                <p>The value <em>AS2-Restart</em> identifies the protocol specified in [as2-restart].
                    Since this protocol is specific to HTTP, it MUST NOT be used with transports 
                    other than <a href="#HTTPTransport">HTTPTransport</a>.
                    Since it depends on some AS2-specific features, it SHOULD NOT be used with HTTP 
                    transports not bound to 
                    an <a href="#AS2Channel">AS2Channel</a>.
                </p>
                <p>This element corresponds to the <em>Pmode[1].Protocol.Restart.Protocol</em> P-Mode 
                    parameter defined in
                    [EBMS3PART2]. </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="RestartInterval" type="xs:duration">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies the  expresses the maximum amount of
                    time the recipient of a message SHOULD cache a temporary incomplete copy of the 
                    message, for a particular message transfer. </p>
                <p>This element corresponds to the <em>Pmode[1].Protocol.Restart.Interval</em> P-Mode 
                    parameter defined in
                    [EBMS3PART2]. </p>
                <p>This element MAY be specified in a <a href="#CPP">CPP</a> for a Receiver transport. 
                    It SHOULD NOT be set for a Sender transport.
                    In <a href="#CPA">CPA</a> formation, the value to be included in the 
                    <a href="#CPA">CPA</a> is the Receiver value,  if present.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- Properties -->

    <xs:element name="Property">
        <xs:annotation>
            <xs:documentation>
                <p>In some messaging protocols including ebMS3, messages and payload parts can carry 
                    arbitrary named properties, with values constrained to be simple values.
                </p>
                <p>In ebMS3, a message property can be configured as an 
                    item on the <em>PMode[1].BusinessInfo.Properties</em> list.
                </p>
                <p>The property <em>CompressionType</em> MUST NOT be set for AS4 as it is reserved for use
                    by the AS4 compression feature (see issue 
                    https://issues.oasis-open.org/browse/EBXMLMSG-75).
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:Description" minOccurs="0"/>
            </xs:sequence>
            <xs:attribute name="name" use="required" type="cppa:non-empty-string">
                <xs:annotation>
                    <xs:documentation>The name of the property.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="type" type="xs:anyURI"/>
            <xs:attribute name="value" use="optional" type="cppa:non-empty-string">
                <xs:annotation>
                    <xs:documentation>The value of the property, if the property has a fixed value. 
                        Note that this functionality is not mentioned in D.3.3 of [EBMS3CORE].</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="minOccurs" type="xs:nonNegativeInteger">
                <xs:annotation>
                    <xs:documentation>The minimum occurrence of the property. 
                        In ebMS3, the allowed values are 0 or 1.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="maxOccurs" type="cppa:maxoccurstype">
                <xs:annotation>
                    <xs:documentation>The maximum occurrence of the property. 
                        In ebMS3, the allowed value is 1.</xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <xs:element name="PropertySet" type="cppa:PropertySetType">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#PropertySet">PropertySet</a> element defines a set of 
                    <a href="#Property">Property</a> elements. It supports 
                    definitions of property sets that are reusable. </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="PropertySetType">
        <xs:sequence>
            <xs:element ref="cppa:Description" minOccurs="0"/>
            <xs:element ref="cppa:Property" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:ID" use="optional">
            <xs:annotation>
                <xs:documentation>An XML identifier, allowing property definitions to be referenced
                    within the XML document. 
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <!-- Payload Profile -->

    <xs:element name="PayloadProfile">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#PayloadProfile">PayloadProfile</a> element provides the logical definition of the
                    expected message content as one or multiple payload parts.  The complementary 
                    <a href="#Packaging">Packaging</a> element provides a mapping to physical packaging constructs.
                    This mapping is done by shared values of <em>PayloadPart/PartName</em> elements and 
                    <em>PayloadPart</em> attributes on <em>Packaging</em> elements.
                </p>
                <p>The <a href="#PayloadProfile">PayloadProfile</a> elements implements the ebMS3 concept of 
                    payload profiles. When used with ebMS3, the mapping to ebMS3 PMode parameters is as 
                    follows:</p>
                <ol>
                    <li>The sequence of <a href="#PayloadPart">PayloadPart</a> elements maps to the 
                        <em>PMode[1].BusinessInfo.PayloadProfile[]</em> P-Mode 
                        parameter list.</li>
                </ol>
                <p>However, CPPA3 uses <a href="#PayloadProfile">PayloadProfile</a> as a general concept, and
                    does not limit its use to ebMS3 channels. </p>
                <p>Payload part definitions are referenced. Multiple payload profiles may reuse payload 
                    part definitions.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:Description" minOccurs="0"/>
                <xs:element ref="cppa:PayloadPart" maxOccurs="unbounded"/>
            </xs:sequence>
            <xs:attribute name="id" type="xs:ID"/>
        </xs:complexType>
    </xs:element>


    <xs:element name="PayloadPart">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#PayloadPart">PayloadPart</a> element provides a logical definition of
                    a payload part. A <a href="#PayloadPart">PayloadPart</a>  MAY be referenced from 
                    a <a href="#PayloadProfile">PayloadProfile</a> and from a 
                    <a href="#Packaging">Packaging</a> element.</p>
                <p>A <a href="#PayloadPart">PayloadPart</a> MAY be signed at payload-level. 
                    A <a href="#Signature">Signature</a> element MAY be provided to record any relevant 
                    constraints on payload signatures, such as constraints on certificates or algorithms 
                    to be used. 
                    Note that processing such signatures is not functionality of the <a href="#Channel">Channel</a> and does not 
                    have to be provided by the Message Service handling that channel, but by business 
                    applications or other components that produce or consume payloads.  
                </p>
                <p>Similarly, a <a href="#PayloadPart">PayloadPart</a> MAY be encrypted at payload-level. 
                    If this is the case, 
                    an <a href="#Encryption">Encryption</a> element MAY be provided to provide any relevant 
                    constraints. As with payload signing, this encryption is not functionality of 
                    the <a href="#Channel">Channel</a> and the responsible Message Service Handler.
                </p>
                <p>Presence of the <a href="#Signature">Signature</a> and <a href="#Encryption">Encryption</a> element defines constraints on,
                    respectively, signing and encryption.   Absence of these elements specifies that no 
                    constraints are set.  Whether payload level signing and encryption is required can be
                    expressed using the <em>requireSignature</em> <em>requireEncryption</em> attributes.                    
                </p>
                <p>In CPPA3, the <a href="#Signature">Signature</a> and <a href="#Encryption">Encryption</a> elements and the <em>requireSignature</em> 
                    and <em>requireEncryption</em> attributes  provide functionality similar to the CPPA2
                    <em>ApplicationCertificateRef</em> and <em>ApplicationCertificateDetails</em> elements. A 
                    difference is that CPPA2 defined these at <em>CollaborationRole</em> level, whereas CPPA3 
                    defines them at <a href="#PayloadPart">PayloadPart</a> level.
                </p>
                <p>Note that use of the <a href="#Signature">Signature</a> and <a href="#Encryption">Encryption</a> elements and the <em>requireSignature</em> 
                    and <em>requireEncryption</em> attributes is not required when messaging is used in a payload-content 
                    agnostic way. In that situation, messaging products MAY ignore the values of these elements. 
                    However, in those situations CPPA3 may still be useful. For example, any distribution mechanisms 
                    for CPPA3 could be leveraged to distribute keys to applications.
                </p>                
                <p>In ebMS3, a <a href="#PayloadPart">PayloadPart</a> corresponds to an item on a 
                    <em>PMode[1].BusinessInfo.PayloadProfile[]</em> list.</p>
                <p>A <a href="#PayloadPart">PayloadPart</a> MAY be associated with one or 
                    multiple <a href="#Schema">Schema</a> elements.                     
                    If more than one <a href="#Schema">Schema</a> element is specified, the part 
                    MUST conform to all specified 
                    schemas.  
                    For example, an XML document may have to conform to both a generic XML document schema 
                    and to a set of 
                    transaction-specific business rules expressed in another schema language.
                </p>
                <p>For ebMS3, these elements in this type map to the payload properties defined for 
                    <em>PayloadProfile[]</em> items, as defined in D.3.3. of ebMS3 CORE.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:Description" minOccurs="0"/>
                <xs:element ref="cppa:PartName"/>
                <xs:element ref="cppa:MIMEContentType" minOccurs="0"/>
                <xs:element ref="cppa:Schema" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:MaxSize" minOccurs="0"/>
                <xs:element ref="cppa:Property" minOccurs="0" maxOccurs="unbounded"/>
                <xs:element ref="cppa:Signature" maxOccurs="1" minOccurs="0"/>
                <xs:element ref="cppa:Encryption" maxOccurs="1" minOccurs="0"/>
            </xs:sequence>
            <xs:attribute name="minOccurs" type="xs:nonNegativeInteger"/>
            <xs:attribute name="maxOccurs" type="cppa:maxoccurstype"/>
            <xs:attribute name="requireSignature" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>To express that payload level signing is REQUIRED, 
                        the <em>requireSignature</em> attribute MUST be set to the value true. 
                        If the <em>requireSignature</em> attribute 
                        is set to false or is absent, then the payload is not constrained to be signed. 
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="requireEncryption" type="xs:boolean">
                <xs:annotation>
                    <xs:documentation>To express that payload level encryption is REQUIRED, 
                        the <em>requireEncryption</em> attribute MUST be set to the value true. 
                        If the <em>requireEncryption</em> attribute 
                        is set to false or is absent, then the payload is not constrained to be encrypted. 
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>

    </xs:element>

    <xs:element name="PartName" type="xs:token">
        <xs:annotation>
            <xs:documentation>
                <p>This element specifies a name for the payload part. This element is used to map parts 
                    defined in a payload profile to package definitions.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="MIMEContentType" type="xs:token">
        <xs:annotation>
            <xs:documentation>
                <p>Specifies the MIME content type of the part.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <!-- Schema and Document Constraints -->

    <xs:element name="Schema">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#Schema">Schema</a> element can be used to associate a 
                    <a href="#PayloadPart">PayloadPart</a> with a particular schema. 
                    For example, parts of type <em>application/xml</em> can be associated 
                    with an XML schema.</p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:sequence>
                <xs:element ref="cppa:Description" minOccurs="0"/>
            </xs:sequence>
            <xs:attribute name="location" type="xs:anyURI" use="optional">
                <xs:annotation>
                    <xs:documentation>
                        <p>The location of the schema as a URI.</p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="version" type="cppa:non-empty-string" use="optional">
                <xs:annotation>
                    <xs:documentation>
                        <p>If not specified in a located schema, the schema version can be specified using this 
                            attribute.</p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="namespace" type="cppa:non-empty-string" use="optional">
                <xs:annotation>
                    <xs:documentation>
                        <p>For XML parts, this attribute specifies the namespace of the root element.</p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
            <xs:attribute name="element" type="cppa:non-empty-string" use="optional">
                <xs:annotation>
                    <xs:documentation>
                        <p>For XML parts, this attribute specifies the name of an XML element that MUST 
                            be used as the root of the part.</p>
                        <p>If this attribute is used, for schemas that use namespaces the <em>namespace</em>
                            attribute MUST be set as well.
                        </p>
                    </xs:documentation>
                </xs:annotation>
            </xs:attribute>
        </xs:complexType>
    </xs:element>

    <!-- Packaging -->

    <xs:element name="Packaging" type="cppa:PackagingType" abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#Packaging">Packaging</a> element supports configuration of the physical packaging 
                    of the message and 
                    its payloads.   It complements the <a href="#PayloadProfile">PayloadProfile</a> element that provides 
                    a logical definition. 
                    This element can be substituted by specialized elements, subject to 
                    any constraints imposed by the message protocol.  This version of CPPA
                    provides support for SOAP with Attachments, MTOM, MIME and simple SOAP packaging, but 
                    supports extensibility to other container types.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="PackagingType" abstract="true">
        <xs:sequence>
            <xs:element ref="cppa:Description" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:ID">
            <xs:annotation>
                <xs:documentation>
                    <p>Identifier of the Package in the <a href="#CPP">CPP</a> or <a href="#CPA">CPA</a>.</p>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:element name="MIMEEnvelope" substitutionGroup="cppa:Packaging" type="cppa:MIMEEnvelopeType">
        <xs:annotation>
            <xs:documentation>
                <p>The MIMEEnvelope element supports packaging using the IETF MIME RFC 2045 specification for
                    multipart envelopers.  It also supports protocols in which some parts are external to the
                    envelope but logically part of it.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="MIMEEnvelopeType">
        <xs:complexContent>
            <xs:extension base="cppa:PackagingType">
                <xs:sequence>
                    <xs:element ref="cppa:MIMEPart" minOccurs="0" maxOccurs="unbounded"/>
                    <xs:element ref="cppa:ExternalPayload" minOccurs="0" maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="MIMEPart" type="cppa:MIMEPartType" abstract="true">
        <xs:annotation>
            <xs:documentation>
                <p>Defines an individual abstract MIME envelope part. Substitutions are defined
                    for simple MIME parts, Multipart/Related MIME parts and compressed
                    variants of these.  Additional substitutions could be defined for other
                    containers that could be transported as MIME envelope content.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="MIMEPartType">
        <xs:annotation>
            <xs:documentation>
                <p>A MIME part type.</p>
                <p>Note that there is no <em>MIMEContentType</em> element in this type, as
                    this is specified for the referenced <a href="#PayloadPart">PayloadPart</a>.  
                    For compressed MIME parts, the MIME type follows from the compression 
                    algorithm used.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:sequence/>
        <xs:attribute name="ContentTransferEncoding" type="cppa:non-empty-string">
            <xs:annotation>
                <xs:documentation>
                    <p>This attribute specifies a MIME Content-Transfer-Encoding that is 
                        to be applied to the MIME part. </p>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>

    <xs:attributeGroup name="FNPreservation">
        <xs:attribute name="PreserveFileName" type="xs:boolean" use="optional">
            <xs:annotation>
                <xs:documentation>
                    <p>This attribute indicates whether the it is possible to process a <em>filename</em> parameter
                        for the <em>Content-Disposition</em> MIME part header as specified in [ediint-fn].
                    </p>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>

    </xs:attributeGroup>

    <xs:attributeGroup name="PackagingForPayloadParts">
        <xs:attribute name="PartName" type="xs:token" use="required">
            <xs:annotation>
                <xs:documentation>
                    <p>The <a href="#SOAPBodyPart">SOAPBodyPart</a> and MIME parts.</p>
                    <p>This attribute identifies a 
                        <a href="#PayloadPart">PayloadPart</a> using its <a href="#PartName">PartName</a>. The PayloadPart must be
                        a part defined in the PayloadProfile associated with the action that links to 
                        the package that contains this part. 
                    </p>
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:attributeGroup>

    <xs:element name="SimpleMIMEPart" substitutionGroup="cppa:MIMEPart"
        type="cppa:SimpleMIMEPartType">
        <xs:annotation>
            <xs:documentation>
                <p>A simple MIME part, i.e. a part that is not itself a multipart part.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="SimpleMIMEPartType">
        <xs:complexContent>
            <xs:extension base="cppa:MIMEPartType">
                <xs:attributeGroup ref="cppa:PackagingForPayloadParts"/>
                <xs:attributeGroup ref="cppa:FNPreservation"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="MIMEMultipartRelated" substitutionGroup="cppa:MIMEPart"
        type="cppa:MIMEMultipartRelatedType">
        <xs:annotation>
            <xs:documentation>
                <p>A Multipart/Related MIME part.</p>
                <p>AS2 supports multiple payloads as a Multipart/Related structure [RFC6362]. 
                    A sending MSH that uses this feature MUST set the "MA" feature.
                    The <em>Version</em> of the <a href="#AS2Channel">AS2Channel</a> 
                    MUST be set to <em>1.2</em>.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="MIMEMultipartRelatedType">
        <xs:complexContent>
            <xs:extension base="cppa:MIMEPartType">
                <xs:sequence>
                    <xs:element ref="cppa:MIMEPart" minOccurs="1" maxOccurs="unbounded"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="SimpleSOAPEnvelope" substitutionGroup="cppa:Packaging"
        type="cppa:SimpleSOAPEnvelopeType">
        <xs:annotation>
            <xs:documentation>
                <p>A Simple SOAP Envelope is an Envelope structured as defined in the SOAP 1.1 or 
                    1.2 specifications, i.e. not an envelope packaged using the W3C SOAP with Attachments 
                    or MTOM specifications. </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="SimpleSOAPEnvelopeType">
        <xs:annotation>
            <xs:documentation>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:PackagingType">
                <xs:sequence>
                    <xs:sequence>
                        <xs:element ref="cppa:SOAPBodyPart" minOccurs="0"/>
                        <xs:element ref="cppa:ExternalPayload" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="SOAPBodyPart">
        <xs:annotation>
            <xs:documentation>
                <p>Payload packaging that uses the SOAP Body.</p>
                <p>The identified PayloadPart must be
                    a part defined in the PayloadProfile associated with the action that links to  
                    the <a href="#SOAPWithAttachmentsEnvelope">SOAPWithAttachmentsEnvelope</a> 
                    package that contains this <a href="#SOAPBodyPart">SOAPBodyPart</a>. 
                    The MIME Content Type of that <a href="#PayloadPart">PayloadPart</a> MUST be <em>application/xml</em>. 
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:attributeGroup ref="cppa:PackagingForPayloadParts"/>
        </xs:complexType>
    </xs:element>

    <xs:element name="SOAPWithAttachmentsEnvelope" substitutionGroup="cppa:Packaging"
        type="cppa:SOAPWithAttachmentsEnvelopeType">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#SOAPWithAttachmentsEnvelope">SOAPWithAttachmentsEnvelope</a> element 
                    supports packaging using the W3C SOAP with 
                    Attachements specification. </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="SOAPWithAttachmentsEnvelopeType">
        <xs:annotation>
            <xs:documentation>
                <p>When used with the ebMS2 protocol or other protocols that use the SOAP Body to store 
                    protocol-dependent data, the <a href="#SOAPBodyPart">SOAPBodyPart</a> MUST NOT be used.</p>
                <p>When used with the ebMS3 protocol or other protocols that allow payload content to be 
                    transported in the SOAP Body, the <a href="#SOAPBodyPart">SOAPBodyPart</a> element MAY be used to 
                    identify a particular <a href="#PayloadPart">PayloadPart</a> that SHOULD be packaged in the SOAP Body. 
                    Note that ebMS3 does not have any PMode parameters to control the placement of payloads. 
                </p>
                <p>For interoperability, at most one XML element MAY be 
                    included in the SOAP Body.   If the <em>maxOccurs</em> for the identified PayloadPart is 
                    greater than 1, only one of these MAY be included in the SOAP Body, meaning all others MUST 
                    be transported as MIME parts or as external payloads.  
                </p>
                <p>Note that the ebMS3 protocol allows an MSH to use a simple SOAP envelope (not using MIME)
                    for messages that consist of at most a single XML payload, carried in the SOAP Body. 
                    Since there are no PMode parameters to control whether content is placed in the Body or
                    as an attachment, this means that an MSH MAY use a simple SOAP if there is just a single
                    uncompressed XML payload.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:PackagingType">
                <xs:sequence>
                    <xs:sequence>
                        <xs:element ref="cppa:SOAPBodyPart" minOccurs="0"/>
                        <xs:element ref="cppa:MIMEPart" minOccurs="0" maxOccurs="unbounded"/>
                        <xs:element ref="cppa:ExternalPayload" minOccurs="0" maxOccurs="1"/>
                    </xs:sequence>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="ExternalPayload" type="cppa:ExternalPayloadType">
        <xs:annotation>
            <xs:documentation>
                <p>An external payload is a payload that is not transported in the message, but is 
                    logically part of it. The external payload instead is referenced.
                    The receiving MSH is responsible for dereferencing the reference, obtaining the
                    payload (e.g. via a secure download) and processing it. 
                </p>
                <p>The channel that is to be used to retrieve the external payload is identified in the child 
                    <a href="#ChannelID">ChannelID</a> element, which is connected to a transport.
                    Specified transport configuration for processing the referenced payload will be
                    available for the <a href="#Transport">Transport</a> associated with that channel. 
                    This could configure, for example, use of IP addresses, client and server certificates, 
                    and user authentication, to be used.
                </p>
                <p>Protocols supporting external payloads constrain the channels that
                    can be used to retrieve the external payloads. 
                    In the case of ebMS2 or ebMS3,  the payload content is not included 
                    as a MIME part or as the SOAP Body in the ebMS3 message. 
                    Instead, it is referenced using the <em>href</em> attribute:
                    </p>
                <ul>
                    <li>In the case of ebMS2, using <em>Manifest/Reference/@href</em>.</li>
                    <li>In the case of ebMS3, using <em>PayloadInfo/PartInfo/@href</em>.</li>
                </ul>
                <p>
                    In this case, the value of the <em>href</em>attribute is a URI, and the mechanism to access 
                    the payload is not an ebMS mechanism, but uses the transports associated with the URI.  
                    For example, in the case of an <em>http(s)</em> URI, it is expected to be retrieved 
                    using an HTTP GET request.   
                    In CPPA3, this mechanism is supported by associating the external payload with a 
                    <a href="#TransportChannel">TransportChannel</a>. Future (or other) protocols not currently 
                    considered for CPPA3 may use other channel types for external payloads.
                </p>
                <p>In Enterprise Integration terminology, the <a href="#ExternalPayload">ExternalPayload</a> feature is an instance of 
                    the <a href="http://www.enterpriseintegrationpatterns.com/patterns/messaging/StoreInLibrary.html">Claim Check</a> 
                    pattern.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="ExternalPayloadType">
        <xs:complexContent>
            <xs:extension base="cppa:PackagingType">
                <xs:sequence>
                    <xs:element ref="cppa:ChannelId" minOccurs="1" maxOccurs="1"/>
                </xs:sequence>
                <xs:attributeGroup ref="cppa:PackagingForPayloadParts"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:element name="MTOMEnvelope" substitutionGroup="cppa:Packaging" type="cppa:MTOMEnvelopeType">
        <xs:annotation>
            <xs:documentation>
                <p>An MTOM Envelope structured as defined in the MTOM specification [SOAP12-MTOM]. </p>
                <p>An MTOM Envelop uses XOP [XOP] to transfer parts of the SOAP message as MIME parts. 
                    However, from an XML infoset point of view, and in submission or delivery, there is 
                    only one structure.
                </p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="MTOMEnvelopeType">
        <xs:annotation>
            <xs:documentation>
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:extension base="cppa:PackagingType">
                <xs:sequence>
                    <xs:sequence>
                        <xs:element ref="cppa:SOAPBodyPart" minOccurs="0"/>
                        <xs:element ref="cppa:ExternalPayload" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <!-- General elements and types -->

    <xs:element name="Expression" type="cppa:non-empty-string">
        <xs:annotation>
            <xs:documentation>
                <p>This element expresses an XPath expression. </p>
                <p>If namespaces are used, XPath expressions MUST use namespaces in Clark notation 
                    ({ns}name) to obviate the need for shared values and definitions of prefixes.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:element name="Description">
        <xs:annotation>
            <xs:documentation>
                <p>The <a href="#Description">Description</a> element provides a natural language description 
                    related to a CPPA3 structure. Since its content is restricted to the
                    <a href="#non-empty-string">non-empty-string</a> type, it is not suited to contain 
                    structured technical documentation. If deemed useful, the <em>href</em> attribute MAY be
                    used to reference external descriptions.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:complexType>
            <xs:simpleContent>
                <xs:extension base="cppa:non-empty-string">
                    <xs:attribute ref="xml:lang" use="required">
                        <xs:annotation>
                            <xs:documentation>The language in which the description is provided.</xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                    <xs:attribute name="href" type="xs:anyURI" use="optional">
                        <xs:annotation>
                            <xs:documentation>A optional reference to additional description material for the 
                                structure.</xs:documentation>
                        </xs:annotation>
                    </xs:attribute>
                </xs:extension>
            </xs:simpleContent>
        </xs:complexType>
    </xs:element>

    <!-- Access Control -->

    <xs:attributeGroup name="acl_attributes">
        <xs:annotation>
            <xs:documentation>
                <p>The <em>allowed</em> and <em>denied</em> attributes in a <a href="#CPP">CPP</a> 
                    control which counterparty or counterparties can participate in an exchange with 
                    the CPP's <a href="#Party">Party</a>.  
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:attribute name="allowed" type="cppa:party_id_list_ref_type" use="optional">
            <xs:annotation>
                <xs:documentation>A reference to a list of allowed party identifiers.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="denied" type="cppa:party_id_list_ref_type" use="optional">
            <xs:annotation>
                <xs:documentation>A reference to a list of denied party identifiers.</xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:attributeGroup>

    <xs:simpleType name="party_id_list_ref_type">
        <xs:annotation>
            <xs:documentation>A reference to a list of party identifiers. This list can be referenced
                using an ID reference, if it is included in the <a href="#CPP">CPP</a>, or using a absolute URI, 
                if it is located using a Uniform Resource Locator and is located outside the <a href="#CPP">CPP</a>.
            </xs:documentation>
        </xs:annotation>
        <xs:union memberTypes="xs:anyURI xs:IDREF"/>
    </xs:simpleType>

    <xs:simpleType name="non-empty-string">
        <xs:annotation>
            <xs:documentation>
                <xs:documentation>A non-empty string.</xs:documentation>
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:element name="MaxSize" type="cppa:SizeType">
        <xs:annotation>
            <xs:documentation>
                <p>Define the maximum value for some size aspect of a message or message part.</p>
            </xs:documentation>
        </xs:annotation>
    </xs:element>

    <xs:complexType name="SizeType">
        <xs:annotation>
            <xs:documentation>
                <p>Defines a size in octets. If the <em>unit</em> attribute is not present, the
                    value of the attribute MUST be a positive integer.
                    If the <em>unit</em> attribute is present with a value U for an element E of
                    type <em>SizeType</em>, 
                    the value V of the attribute is equivalent to the attribute being absent on E
                    and the value V multiplied by the BIPM interpretation of the unit prefix.
                </p>
            </xs:documentation>
        </xs:annotation>
        <xs:simpleContent>
            <xs:extension base="cppa:posfloat">
                <xs:attribute name="unit" use="optional">
                    <xs:annotation>
                        <xs:documentation>The optional <em>unit</em> attribute aims to facilitate
                            human-readable size specification using 
                            BIPM (International Bureau of Weights and Measures) symbol prefix, e.g. 
                            use <em>k</em> for 10<sup>3</sup> or <em>G</em> for 10<sup>9</sup> sizes.
                        </xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                        <xs:restriction base="xs:token">
                            <xs:enumeration value="da"/>
                            <xs:enumeration value="h"/>
                            <xs:enumeration value="k"/>
                            <xs:enumeration value="M"/>
                            <xs:enumeration value="G"/>
                            <xs:enumeration value="T"/>
                            <xs:enumeration value="P"/>
                            <xs:enumeration value="E"/>
                            <xs:enumeration value="Z"/>
                            <xs:enumeration value="Y"/>
                        </xs:restriction>
                    </xs:simpleType>
                </xs:attribute>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>

    <xs:simpleType name="posfloat">
        <xs:restriction base="xs:float">
            <xs:minExclusive value="0"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="unboundedtype">
        <xs:restriction base="xs:string">
            <xs:enumeration value="unbounded"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:simpleType name="maxoccurstype">
        <xs:union memberTypes="xs:nonNegativeInteger cppa:unboundedtype"/>
    </xs:simpleType>

    <xs:simpleType name="usetype">
        <xs:restriction base="xs:token">
            <xs:enumeration value="optional"/>
            <xs:enumeration value="required"/>
        </xs:restriction>
    </xs:simpleType>

</xs:schema>
