<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://www.example.org/Response"
        xmlns:tns="http://www.example.org/Response"
        elementFormDefault="qualified">
    <element name="ShipmentCreationResponse" type="tns:ShipmentCreationResponseType">
    </element>
    <complexType name="ContextType">
    	<sequence>
    		<element name="Login" type="string" minOccurs="1"
    			maxOccurs="1" nillable="false">
    			<annotation>
    				<documentation>
    					The user name of the client who calls the
    					service operation. Will be used for
    					authentication. The user name will be provided
    					by MondialRelay.
    				</documentation>
    			</annotation>
    		</element>
    		<element name="Password" type="string" minOccurs="1"
    			maxOccurs="1" nillable="false">
    			<annotation>
    				<documentation>
    					The password of the client who calls the service
    					operation. Will be used for authentication. The
    					password will be provided by MondialRelay.
    				</documentation>
    			</annotation>
    		</element>
    		<element name="CustomerId" minOccurs="1" maxOccurs="1">
    			<annotation>
    				<documentation>
    					The Customer Id of the client who calls the
    					service operation. Will be used for
    					authentication. The customerId will be provided
    					by MondialRelay.
    				</documentation>
    			</annotation>
    			<simpleType>
    				<restriction base="string">
    					<minLength value="2"></minLength>
    					<maxLength value="8"></maxLength>
    					<whiteSpace value="collapse"></whiteSpace>
    				</restriction>
    			</simpleType>
    		</element>
    		<element name="Culture" minOccurs="1" maxOccurs="1">
    			<annotation>
    				<documentation>
    					The culture that will be used to process the
    					request and produce the output expected format :
    					en-US
    				</documentation>
    			</annotation>
    			<simpleType>
    				<restriction base="string">
    					<length value="5"></length>
    					<pattern value="\w{2}-\w{2}"></pattern>
    				</restriction>
    			</simpleType>
    		</element>
    		<element name="VersionAPI" minOccurs="1" maxOccurs="1">
    			<annotation>
    				<documentation>
    					The reference of the API version.
    				</documentation>
    			</annotation>
    			<simpleType>
    				<restriction base="string">
    					<minLength value="0"></minLength>
    				</restriction>
    			</simpleType>
    		</element>
    	</sequence>
    </complexType>

    <complexType name="OutputOptionsType">
    	<sequence>
    		<element name="OutputFormat" minOccurs="0" maxOccurs="1">
    			<annotation>
    				<documentation>
    					The printer model that will receive the ZPL
    					code. Bellow the model list of compatible
    					printers:
    				</documentation>
    			</annotation>
    			<simpleType>
    				<restriction base="string">
    					<minLength value="0"></minLength>
    				</restriction>
    			</simpleType>
    		</element>
    		<element name="OutputType" minOccurs="1" maxOccurs="1">
    			<simpleType>
    				<restriction base="string">
    					<minLength value="0"></minLength>
    				</restriction>
    			</simpleType>
    		</element>
    	</sequence>
    </complexType>
    
    <complexType name="ShipmentCreationResponseType">
    	<sequence>
    		<element name="Context" type="tns:ContextType"></element>
    		<element name="OutputOptions"
    			type="tns:OutputOptionsType">
    		</element>
    		<element name="ShipmentsList"
    			type="tns:ShipmentsListType">
    		</element>
    		<element name="StatusList" type="tns:StatusListType" minOccurs="0" maxOccurs="1"></element>
    	</sequence>
    </complexType>

    <complexType name="StatusListType">
    	<sequence>
    		<element name="Status" type="tns:StatusType" minOccurs="0" maxOccurs="unbounded"></element>
    	</sequence>
    </complexType>

    <complexType name="StatusType">
    	<attribute name="Code" type="string"></attribute>
    	<attribute name="Level" type="string"></attribute>
    	<attribute name="Message" type="string"></attribute>
    </complexType>

    <complexType name="ShipmentsListType">
    	<sequence>
    		<element name="Shipment" type="tns:ShipmentOutputType" minOccurs="1" maxOccurs="unbounded"></element>
    	</sequence>
    </complexType>

    <complexType name="ShipmentOutputType">
    	<sequence>
    		<element name="LabelList" type="tns:LabelListType"></element>
    	</sequence>
    </complexType>

    <complexType name="LabelListType">
    	<sequence>
    		<element name="Label" type="tns:LabelType"></element>
    	</sequence>
    </complexType>

    <complexType name="LabelType">
    	<sequence>
    		<element name="RawContent" type="tns:LabelRawContentType"></element>
    		<element name="Output" type="string" minOccurs="1" maxOccurs="1" nillable="true"></element>
    	</sequence>
    </complexType>

    <complexType name="LabelRawContentType">
    	<sequence>
    		<element name="Parcel" type="tns:ParcelInformationType" minOccurs="1" maxOccurs="1"></element>
    		<element name="Sender" type="tns:AddressType" minOccurs="1" maxOccurs="1"></element>
    		<element name="Recipient" type="tns:AddressType" minOccurs="1" maxOccurs="1"></element>
        <element name="LabelValues" type ="tns:KeyValueType" minOccurs="0"></element>
    		<element name="RoutingArguments"
    			type="tns:RoutingArgumentType" minOccurs="1" maxOccurs="2">
    		</element>
    		<element name="Barcodes" type="tns:BarcodesType" minOccurs="1" maxOccurs="1"></element>
    	</sequence>
    </complexType>

    <complexType name="ParcelInformationType">
    	<sequence>
    		<element name="Data" type="tns:LabelParcelDataType" minOccurs="1" maxOccurs="unbounded"></element>
    	</sequence>
    </complexType>
    
    <complexType name="AddressType">
    	<sequence>
    		<element name="AddressLines" type="tns:AddressLineType"
    			minOccurs="1" maxOccurs="unbounded">
    		</element>
    	</sequence>
    	<attribute name="ZoneTitle" type="string"></attribute>
    </complexType>

    <complexType name="AddressLineType">
    	<sequence>
    	</sequence>
    	<attribute name="Order" type="int"></attribute>
    	<attribute name="AddressLine" type="string"></attribute>
    </complexType>

    <complexType name="RoutingArgumentType">
    	<sequence>
    		<element name="RoutingArgumentLines" type="tns:RoutingArgumentLineType" minOccurs="1" maxOccurs="unbounded"></element>
    	</sequence>
    	<attribute name="CarrierCode" type="string"></attribute>
		<attribute name="Role" type="string"></attribute>
    </complexType>
	
	<complexType name="RoutingArgumentLineType">
		<sequence>
			<element name="Order" type="int"></element>
			<element name="RoutingArgumentLine" type="tns:KeyValueType"></element>
		</sequence>
	</complexType>
	
	 <complexType name="KeyValueType">
    	<attribute name="Key" type="string"></attribute>
    	<attribute name="Value" type="string"></attribute>
    </complexType>
	
    <complexType name="BarcodesType">
    	<sequence>
    		<element name="Barcode" type="tns:BarcodeType" minOccurs="1" maxOccurs="2"></element>
    	</sequence>
    </complexType>

    <complexType name="BarcodeType">
    	<sequence></sequence>
    	<attribute name="Type" type="string"></attribute>
    	<attribute name="DisplayedValue" type="string"></attribute>
    	<attribute name="Value" type="string"></attribute>
		<attribute name="CarrierCode" type="string"></attribute>
    </complexType>

    <complexType name="LabelParcelDataType">
		<attribute name="Order" type="int"></attribute>
    	<attribute name="Title" type="string"></attribute>
    	<attribute name="Value" type="string"></attribute>
    </complexType>
</schema>