<?xml version="1.0" encoding="UTF-8"?>
<!-- ********************************************************************************** -->
<!-- IBM SVN information                                                    			-->
<!-- Version:         $Revision: 6835 $													-->
<!-- LastChangedDate: $LastChangedDate: 2015-12-04 12:16:35 +0100 (Fr, 04 Dez 2015) $  	-->
<!-- LastChangedBy:   $LastChangedBy: stefan.thamm@de.ibm.com $						   	-->
<!-- ********************************************************************************** -->
<xsd:schema
	targetNamespace="http://paymentorder.justice.eu/Message/V3_0"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:msg="http://paymentorder.justice.eu/Message/V3_0"
	xmlns:payload="http://paymentorder.justice.eu/Payload/V3_0"
	elementFormDefault="unqualified" attributeFormDefault="unqualified"
	version="3.2"> 

	<xsd:import schemaLocation="Payload.xsd"
		namespace="http://paymentorder.justice.eu/Payload/V3_0" />

	<xsd:include schemaLocation="SimpleTypes.xsd" />
	<xsd:include schemaLocation="BusinessTypes.xsd" /> <!-- added in 3.0 -->
	<xsd:include schemaLocation="CatalogTypes.xsd" />

	<xsd:element name="EUPOMessage" type="msg:EUPOMessageType"
		abstract="true" />
	<xsd:element name="IncomingMessage" type="msg:IncomingMessageType"
		substitutionGroup="msg:EUPOMessage" />
	<xsd:element name="OutgoingMessage" type="msg:OutgoingMessageType"
		substitutionGroup="msg:EUPOMessage" />

	<xsd:complexType name="EUPOMessageType" abstract="true" />

	<xsd:complexType name="IncomingMessageType">
		<xsd:complexContent>
			<xsd:extension base="msg:EUPOMessageType">
				<xsd:sequence>
					<xsd:element name="Header"
						type="msg:IncomingHeaderType" />
					<xsd:element ref="payload:IncomingPayload" />
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="OutgoingMessageType">
		<xsd:complexContent>
			<xsd:extension base="msg:EUPOMessageType">
				<xsd:sequence>
					<xsd:element name="Header"
						type="msg:OutgoingHeaderType" />
					<xsd:element ref="payload:OutgoingPayload" />
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<!-- new in 3.0 -->
	<xsd:complexType name="HeaderType" abstract="true">
		<xsd:sequence>
			<xsd:element minOccurs="0" maxOccurs="unbounded"
				name="Attachment" type="msg:AttachmentType"/>  <!-- since 3.0 -->
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="IncomingHeaderType">
		<xsd:complexContent>
			<xsd:extension base="msg:HeaderType">
				<xsd:sequence>
					<xsd:element minOccurs="1" maxOccurs="1"
						name="ChannelMessageId" type="msg:String_150_Value" />
					<xsd:element minOccurs="1" maxOccurs="1"
						name="TimeOfReceipt" type="msg:DateTimeValue" />
					<xsd:element minOccurs="1" maxOccurs="1" name="Participant"
						type="msg:ParticipantType" />
					<xsd:element minOccurs="0" maxOccurs="1"
						name="ParticipantData" type="msg:ParticipantDataType" />
					<xsd:element minOccurs="0" maxOccurs="1"
						name="ExternalReferenceData" type="msg:String_4096_Value" />
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="OutgoingHeaderType">
		<xsd:complexContent>
			<xsd:extension base="msg:HeaderType">
				<xsd:sequence>
					<xsd:element name="MessageId" type="msg:String_256_Value" />
					<xsd:element name="RefChannelMessageId"	type="msg:String_150_Value" minOccurs="0"/>
					<!-- <xsd:element name="AttachmentCount" type="msg:IntegerValue" /> --> <!-- deleted in 3.0 -->
					<xsd:element name="Participant" type="msg:ParticipantType" />
					<xsd:element name="ExternalReferenceData"
						type="msg:String_4096_Value" minOccurs="0" />
					<xsd:element name="TimeOfCreation" type="xsd:dateTime" />
				</xsd:sequence>
			</xsd:extension>
		</xsd:complexContent>
	</xsd:complexType>

	<xsd:complexType name="ParticipantType">
		<xsd:sequence>
			<xsd:element name="Id" type="msg:String_48_Value" />
			<xsd:element name="Channel" minOccurs="0">
				<xsd:simpleType>
					<xsd:restriction base="msg:String_128_Value">
						<xsd:enumeration value="ERV" />
						<xsd:enumeration value="EGVP" />
					</xsd:restriction>
				</xsd:simpleType>
			</xsd:element>
			 <!--  optional since 2.1 -->
			 <!-- required since 3.0 -->
			 <!-- choice since 3.6 -->
			 <xsd:choice>
				<xsd:element name="Country" type="msg:ISOCountryCatalogType"/>
				<xsd:element name="ECodex" type="msg:ECodexType"/>
 			</xsd:choice>
		</xsd:sequence>
	</xsd:complexType>

	<xsd:complexType name="ParticipantDataType">
		<xsd:sequence>
			<xsd:element name="Name" type="msg:String_128_Value"
				minOccurs="0" />
			<!-- deleted with 3.0
			<xsd:element name="Country" type="msg:String_128_Value"
				minOccurs="0" />  -->
			<xsd:element name="PostalCode" type="msg:String_128_Value"
				minOccurs="0" />
			<xsd:element name="City" type="msg:String_128_Value"
				minOccurs="0" />
			<xsd:element name="Street" type="msg:String_128_Value"
				minOccurs="0" />
			<xsd:element name="StreetNumber" type="msg:String_128_Value"
				minOccurs="0" />
			<xsd:element name="Other" type="msg:String_4096_Value"
				minOccurs="0" />
		</xsd:sequence>
	</xsd:complexType>

	<!-- since 3.6 -->
	<xsd:complexType name="ECodexType">
		<xsd:sequence>
			<xsd:element name="ConversationId" type="msg:String_128_Value" />
			<xsd:element name="GatewayCode" type="msg:String_128_Value" />
		</xsd:sequence>
	</xsd:complexType>
	
</xsd:schema>