<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <!-- service type -->
  <xs:simpleType name="serviceType">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- vehicle type -->
  <xs:simpleType name="vehicleType">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- proof of delivery type -->
  <xs:simpleType name="proofOfDeliveryType">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="damageType">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- status -->
  <xs:simpleType name="status">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- product -->
  <xs:simpleType name="product">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- delivery option -->
  <xs:simpleType name="deliveryOption">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- capacity type -->
  <xs:simpleType name="capacityType">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- expense type -->
  <xs:simpleType name="expenseType">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- add service type -->
  <xs:simpleType name="extraType">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- notification type -->
  <xs:simpleType name="notificationType">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- notificationSelection -->
  <xs:simpleType name="notificationSelection">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- notificationTrigger -->
  <xs:simpleType name="notificationTrigger">
    <xs:restriction base="xs:string">
      <xs:enumeration value="STATUS"/>
      <xs:enumeration value="DAMAGE"/>
      <xs:enumeration value="POD"/>
      <xs:enumeration value="VEHICLESCAN"/>
      <xs:enumeration value="QUERYSET"/>
      <xs:enumeration value="ROUTED"/>
      <xs:enumeration value="FIRSTSCAN"/>
      <xs:enumeration value="LASTTERMINALSCAN"/>
      <xs:enumeration value="DEPARTURESCANONLASTTERMINAL"/>
      <xs:enumeration value="status"/>
      <xs:enumeration value="damage"/>
      <xs:enumeration value="pod"/>
      <xs:enumeration value="vehiclescan"/>
      <xs:enumeration value="queryset"/>
      <xs:enumeration value="routed"/>
      <xs:enumeration value="firstscan"/>
      <xs:enumeration value="lastterminalscan"/>
      <xs:enumeration value="departurescanonlastterminal"/>
    </xs:restriction>
  </xs:simpleType>
  <!-- notificationReceiver -->
  <xs:simpleType name="notificationReceiver">
    <xs:restriction base="xs:string">
      <xs:enumeration value="MANUAL"/>
      <xs:enumeration value="RECEIVER"/>
      <xs:enumeration value="SENDER"/>
      <xs:enumeration value="CUSTOMER"/>
      <xs:enumeration value="REFERENCE"/>
      <xs:enumeration value="manual"/>
      <xs:enumeration value="receiver"/>
      <xs:enumeration value="sender"/>
      <xs:enumeration value="customer"/>
      <xs:enumeration value="reference"/>
    </xs:restriction>
  </xs:simpleType>
  <!-- hub -->
  <xs:simpleType name="hub">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- price item -->
  <xs:simpleType name="priceItem">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- region -->
  <xs:simpleType name="region">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- trail -->
  <xs:simpleType name="trail">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- query set -->
  <xs:simpleType name="querySet">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="timeFailureReason">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- message type -->
  <xs:simpleType name="messageType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="new" />                      <!-- Create new order -->
      <xs:enumeration value="update" />                   <!-- Update existing order -->
      <xs:enumeration value="revoke" />                   <!-- Revoke order -->
      <xs:enumeration value="pod" />                      <!-- Create Pod -->
      <xs:enumeration value="status" />                   <!-- Update status -->
      <xs:enumeration value="packagescan" />              <!-- Create package scan -->
      <xs:enumeration value="freightbillscan" />          <!-- Create freight bill scan -->
      <xs:enumeration value="attachment" />               <!-- Create attachment -->
      <xs:enumeration value="internetconfirmation" />     <!-- Internet/EDI confirmation in order reception -->
      <xs:enumeration value="pricerequest" />             <!-- Price request -->
      <xs:enumeration value="merge" />                    <!-- Merge with existing order -->
      <xs:enumeration value="packageweightcorrection" />  <!-- Create package weight correction -->
      <xs:enumeration value="damage" />                   <!-- Create damage/ -->
      <xs:enumeration value="priceitem" />                <!-- Create/update price item -->
      <xs:enumeration value="customer" />                 <!-- Create/update customer -->
      <xs:enumeration value="updatesortorder" />          <!-- Update shipment sort order, estimated times and resource suggestion -->
      <xs:enumeration value="response" />                 <!-- Response from receiving system for exported order -->
      <xs:enumeration value="externalcredit" />           <!-- Create external credit -->
      <xs:enumeration value="package" />           <!-- Create/Update/Delete package -->
      <xs:enumeration value="NEW" />
      <xs:enumeration value="UPDATE" />
      <xs:enumeration value="REVOKE" />
      <xs:enumeration value="POD" />
      <xs:enumeration value="STATUS" />
      <xs:enumeration value="PACKAGESCAN" />
      <xs:enumeration value="FREIGHTBILLSCAN" />
      <xs:enumeration value="ATTACHMENT" />
      <xs:enumeration value="INTERNETCONFIRMATION" />
      <xs:enumeration value="PRICEREQUEST" />
      <xs:enumeration value="MERGE" />
      <xs:enumeration value="PACKAGEWEIGHTCORRECTION" />
      <xs:enumeration value="DAMAGE" />
      <xs:enumeration value="PRICEITEM" />
      <xs:enumeration value="CUSTOMER" />
      <xs:enumeration value="UPDATESORTORDER" />
      <xs:enumeration value="RESPONSE" />
      <xs:enumeration value="EXTRNALCREDIT" />
      <xs:enumeration value="PACKAGE" />
    </xs:restriction>
  </xs:simpleType>
  <!-- response type -->
  <xs:simpleType name="responseType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="imported" />
      <xs:enumeration value="failed" />
      <xs:enumeration value="accepted" />
      <xs:enumeration value="rejected" />
      <xs:enumeration value="IMPORTED" />
      <xs:enumeration value="FAILED" />
      <xs:enumeration value="ACCEPTED" />
      <xs:enumeration value="REJECTED" />
    </xs:restriction>
  </xs:simpleType>
  <!-- payer -->
  <xs:simpleType name="payer">
    <xs:restriction base="xs:string">
      <xs:enumeration value="sender" />
      <xs:enumeration value="receiver" />
      <xs:enumeration value="other" />
      <xs:enumeration value="SENDER" />
      <xs:enumeration value="RECEIVER" />
      <xs:enumeration value="OTHER" />
    </xs:restriction>
  </xs:simpleType>
  <!-- address type -->
  <xs:simpleType name="addressType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="pickup" />
      <xs:enumeration value="delivery" />
      <xs:enumeration value="linehaul" />
      <xs:enumeration value="servicepoint" />
      <xs:enumeration value="PICKUP" />
      <xs:enumeration value="DELIVERY" />
      <xs:enumeration value="LINEHAUL" />
      <xs:enumeration value="SERVICEPOINT" />
    </xs:restriction>
  </xs:simpleType>
  <!--customer address type -->
  <xs:simpleType name="customerAddressType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="visit" />
      <xs:enumeration value="invoice" />
      <xs:enumeration value="VISIT" />
      <xs:enumeration value="INVOICE" />
    </xs:restriction>
  </xs:simpleType>
  <!-- attachment type -->
  <xs:simpleType name="attachmentType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="unknown" />
      <xs:enumeration value="cmr" />
      <xs:enumeration value="assignmentlist" />
      <xs:enumeration value="freightbill" />
      <xs:enumeration value="awb" />
      <xs:enumeration value="pod" />
      <xs:enumeration value="damage" />
      <xs:enumeration value="image" />
      <xs:enumeration value="customsdocument" />
      <xs:enumeration value="edi" />
      <xs:enumeration value="packagelabel" />
      <xs:enumeration value="UNKNOWN" />
      <xs:enumeration value="CMR" />
      <xs:enumeration value="ASSIGNMENTLIST" />
      <xs:enumeration value="FREIGHTBILL" />
      <xs:enumeration value="AWB" />
      <xs:enumeration value="POD" />
      <xs:enumeration value="DAMAGE" />
      <xs:enumeration value="IMAGE" />
      <xs:enumeration value="CUSTOMSDOCUMENT" />
      <xs:enumeration value="EDI" />
      <xs:enumeration value="PACKAGELABEL" />
    </xs:restriction>
  </xs:simpleType>
  <!-- scan type -->
  <xs:simpleType name="scanType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="arrival" />
      <xs:enumeration value="departure" />
      <xs:enumeration value="floorcheck" />
      <xs:enumeration value="arrivalofconsignment" />
      <xs:enumeration value="departureofconsignment" />
      <xs:enumeration value="floorcheckofconsignment" />
      <xs:enumeration value="ARRIVAL" />
      <xs:enumeration value="DEPARTURE" />
      <xs:enumeration value="FLOORCHECK" />
      <xs:enumeration value="ARRIVALOFCONSIGNMENT" />
      <xs:enumeration value="DEPARTUREOFCONSIGNMENT" />
      <xs:enumeration value="FLOORCHECKOFCONSIGNMENT" />
    </xs:restriction>
  </xs:simpleType>
  <xs:simpleType name="state">
    <xs:restriction base="xs:string">
      <xs:enumeration value="unchanged" />
      <xs:enumeration value="new" />
      <xs:enumeration value="update" />
      <xs:enumeration value="delete" />
      <xs:enumeration value="UNCHANGED" />
      <xs:enumeration value="NEW" />
      <xs:enumeration value="UPDATE" />
      <xs:enumeration value="DELETE" />
    </xs:restriction>
  </xs:simpleType>
  <!-- vehicle Id type -->
  <xs:simpleType name="resourceIdType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="number" />
    </xs:restriction>
  </xs:simpleType>
  <!-- query -->
  <xs:simpleType name="query">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- loose item type -->
  <xs:simpleType name="looseItemType">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>
  <!-- String (50) -->
  <xs:simpleType name="string50">
    <xs:restriction base="xs:string">
      <xs:maxLength value="50" />
    </xs:restriction>
  </xs:simpleType>
  <!-- String (255) -->
  <xs:simpleType name="string255">
    <xs:restriction base="xs:string">
      <xs:maxLength value="255" />
    </xs:restriction>
  </xs:simpleType>
  <!-- String (1024) -->
  <xs:simpleType name="string1024">
    <xs:restriction base="xs:string">
      <xs:maxLength value="1024" />
    </xs:restriction>
  </xs:simpleType>
  <!-- String (2048) -->
  <xs:simpleType name="string2048">
    <xs:restriction base="xs:string">
      <xs:maxLength value="2048" />
    </xs:restriction>
  </xs:simpleType>
  <!-- String (MAX) -->
  <xs:simpleType name="stringMax">
    <xs:restriction base="xs:string">
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="boolean">
    <xs:restriction base="xs:string">
      <xs:enumeration value="true"/>
      <xs:enumeration value="false"/>
      <xs:enumeration value="True"/>
      <xs:enumeration value="False"/>
      <xs:enumeration value="TRUE"/>
      <xs:enumeration value="FALSE"/>
    </xs:restriction>
  </xs:simpleType>
  
  <!-- Decimal (18,6) -->
  <xs:simpleType name="decimal186">
    <xs:restriction base="xs:decimal">
      <xs:totalDigits value="18" />
      <xs:fractionDigits value="6" />
    </xs:restriction>
  </xs:simpleType>

  <!-- Decimal (6,2) -->
  <xs:simpleType name="decimal62">
    <xs:restriction base="xs:decimal">
      <xs:totalDigits value="6" />
      <xs:fractionDigits value="2" />
    </xs:restriction>
  </xs:simpleType>
  
  <xs:element name="transfer">
   <xs:complexType>
      <xs:sequence>
        <!-- Only to be used in Opter -->
        <!-- Import and export-->
        <xs:element name="implemented" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>  <!-- Example for text output: implemented=false; -->
        <xs:element name="fileNameK2" type="string255" minOccurs="0" maxOccurs="1" nillable="false"/> 
        <!-- Only export-->
        <xs:element name="emailSubjectK2" type="string255" minOccurs="0" maxOccurs="1" nillable="false"/> 
        <xs:element name="emailBodyK2" type="string1024" minOccurs="0" maxOccurs="1" nillable="false"/> 
        <xs:element name="emailRecipientK2" type="string255" minOccurs="0" maxOccurs="1" nillable="false"/> 
        <!-- Used for HttpXmlTransformTransport -->
        <xs:element name="httpContentTypeK2" type="string255" minOccurs="0" maxOccurs="1" nillable="false"/> <!-- Default is application/x-www-form-urlencoded. Example: application/xml, application/json --> 
        <xs:element name="httpHeaderK2" type="string255" minOccurs="0" maxOccurs="1" nillable="false"/> <!-- Use : to separate header text and header values. Also use : to separate headers and enter multiple headers -->
        <xs:element name="httpMethodK2" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/> <!-- Set to POST or PUT. Default is POST -->
        <xs:element name="httpUrlK2" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>    <!-- Set url dynamically. Default is Url set in transport-->
        
        <xs:element name="batchHeaderK2" type="string1024" minOccurs="0" maxOccurs="1" nillable="false"/>  <!-- Use as parent element for header when exporting a batch -->
        
		<!-- Used to pass query parameters and values to api query defined in transfer -->
		<xs:element name="apiQueryOpter" minOccurs="0" maxOccurs="1">  
			<xs:complexType>
                <xs:sequence>
		            <xs:element name="queryValue" type="string50" minOccurs="0" maxOccurs="unbounded"  nillable="false"/> 
		        </xs:sequence>
			    <xs:attribute name="queryParameter" type="string50" use="required" /> 
            </xs:complexType>
		 </xs:element>
			
        <xs:element name="header" minOccurs="1" maxOccurs="1" nillable="false">
          <xs:complexType>
            <xs:sequence>
              <!--Time when file was created-->
              <xs:element name="timestamp" type="xs:dateTime" minOccurs="1" maxOccurs="1" nillable="false"/> 
              <!--Time in ticks when file was created-->
              <xs:element name="timestampTicks" type="xs:long" minOccurs="0" maxOccurs="1" nillable="false"/> 
              <!--Sender company name-->
              <xs:element name="sender" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/> 
              <!--Receiver company name-->
              <xs:element name="receiver" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
              <!--Only used in internal OpterLink transfer-->
              <xs:element name="receiverGuid" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
              <!--Batch counter for exported batch files -->
              <xs:element name="batchCount" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="order">
          <xs:complexType>
            <xs:sequence>
              <!-- settings to be used when importing to Opter -->
              <xs:element name="settingsK2" minOccurs="0" maxOccurs="1" nillable="false">
                <xs:complexType>
                  <xs:sequence>
                    <!--Message should not be imported -->
                    <xs:element name="notImplemented" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <!-- Duplicate check on external id-->
                    <xs:element name="duplicateExternalIdCheck" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/> 
                     <!--Duplicate check on freight bill number-->
                    <xs:element name="duplicateFreightBillCheck" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!--Create new order if not already exists. Only used for messageType=update -->
                    <xs:element name="createNewOnUpdate" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <!--Do not update existing customer. Only used for message type customer -->                
                    <xs:element name="doNotUpdateCustomer" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>  
                    <!--Clear all existing packages on order when messageType=update-->  
                    <xs:element name="clearPackagesOnUpdate" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!--Clear all existing delivery options on order when messageType=update -->
                    <xs:element name="clearOptionsOnUpdate" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!-- Always replace(instead of adding to existing) internal/external messages on order when messageType=update -->
                    <xs:element name="replaceMessagesOnUpdate" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!--No routes are auto created. Default is false for messageType=new and true for messageType=update -->  
                    <xs:element name="noAutoDispatch" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <!--Overrides auto dispached dates/times with dates/times from file or service type -->  
                    <xs:element name="overrideAutoDispatchTimes" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!-- If service type times, opening hours and extra days should be used. Default is true for messageType=new and false for messageType=update -->
                    <xs:element name="adjustTimes" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!-- If auto printing should be triggered. Default is true for messageType=new and false for messageType=update and messageType=packagescan -->
                    <xs:element name="autoPrintPackageLabel" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="autoPrintSortLabel" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="autoPrintFreightBill" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!-- If specific hub for auto printing should be used -->
                    <xs:element name="autoPrintPackageLabelHubCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="autoPrintSortLabelHubCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="autoPrintFreightBillHubCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!-- Additional import handled as messageType=update if messageType is not new/update/merge and is not triggering an update export back. Most commonly used for messageType=response. -->
                    <xs:element name="updateOrder" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!-- If customer code is allowed to be changed for messageType=update -->
                    <xs:element name="allowChangeCustomerCode" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!-- If point to point shipment should be auto consigned -->
                    <xs:element name="autoConsignmentTypeCodePointToPoint" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!-- If pickup shipment should be auto consigned -->
                    <xs:element name="autoConsignmentTypeCodePickup" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!-- If delivery shipment should be auto consigned -->
                    <xs:element name="autoConsignmentTypeCodeDelivery" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>  
                    <xs:element name="noUpdateIfReadyForInvoicing" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>                    
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="message" minOccurs="1" maxOccurs="1" nillable="false">
                <xs:complexType>
                  <xs:sequence>
                     <!--Unique sending number-->
                    <xs:element name="messageId" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false" />
                    <!--Type of message-->
                    <xs:element name="messageType" type="messageType" minOccurs="1" maxOccurs="1" nillable="false"/> 
                    <!--If file is a reply sent from receiving system after order has been created/updated. Is only used for messageType=update and is not triggering an update export back -->
                    <!--Obsolete after new messageType=response and settingK2/updateOrder setting was added. Set updateOrder=true for messageType=response instead  -->
                    <xs:element name="response" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <!--Validate in order reception. Only used when importing to Opter-->
                    <xs:element name="validate" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <!--Counter for specific shipment and transfer. Only used when exporting from Opter-->
                    <xs:element name="messageCount" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <!--Counter for specific message type, shipment and transfer. Only used when exporting from Opter-->
                    <xs:element name="messageTypeCount" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/> 
                     <!--Counter for specific transfer. Only used when exporting from Opter-->
                    <xs:element name="messageTotalCount" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!--Counter for specific message type and transfer. Only used when exporting from Opter-->
                    <xs:element name="messageTypeTotalCount" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/> 
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <!-- Only used for messageType=response -->
              <xs:element name="response" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <!-- Imported message id response is sent for -->
                    <xs:element name="messageId" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!-- Imported message type response is sent for -->
                    <xs:element name="messageType" type="messageType" minOccurs="1" maxOccurs="1" nillable="false"/>
                    <!-- Only used when response is imported from Opter Web Service  -->
                    <xs:element name="base64Response" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="errorMessage" type="xs:string"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="warningMessage" type="xs:string"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <!-- Only used when response is exported from Opter Web Service -->
                    <xs:element minOccurs="0" maxOccurs="1" name="errors">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="error">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="string50">
                                  <xs:attribute name="type" type="xs:int" use="required" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element minOccurs="0" maxOccurs="1" name="warnings">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element minOccurs="0" maxOccurs="unbounded" name="warning">
                            <xs:complexType>
                              <xs:simpleContent>
                                <xs:extension base="string50">
                                  <xs:attribute name="type" type="xs:int" use="required" />
                                </xs:extension>
                              </xs:simpleContent>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="type" type="responseType" use="required" />
                </xs:complexType>
              </xs:element>
              <xs:element name="identification" minOccurs="1" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <!--Order id in system that receives the file-->
                    <xs:element name="externalOrderId" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <!--Order sub id in system that receives the filed-->
                    <xs:element name="externalOrderSubId" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!--Order id in system that sends the file. Used as merge id if messageType=merge-->
                    <xs:element name="internalOrderId" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <!--Order sub id in system that sends the file. Used as merge sub id if messageType=merge-->
                    <xs:element name="internalOrderSubId" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <!--Order id if messageType=merge-->
                    <xs:element name="mergeOrderId" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <!--Order sub id if messageType=merge-->
                    <xs:element name="mergeOrderSubId" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <!--Order id of the consignment if order is consigned. Only used when exporting from Opter-->
                    <xs:element name="consignmentOrderId" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!--External transactionids not visible and needed in Opter but needed when exporting from Opter-->
                    <xs:element name="externalTransactionId1" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="externalTransactionId2" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!--External jobid not visible and needed in Opter but needed when exporting from Opter-->
                    <xs:element name="externalJobId" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!--External state not visible and needed in Opter but needed when exporting from Opter-->
                    <xs:element name="externalState" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!--External data not visible and needed in Opter but needed when exporting from Opter-->
                    <xs:element name="externalData" type="stringMax" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!--If order is spawned-->
                    <xs:element name="spawn" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/> 
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="serviceData" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <!--Only used if multiple price lists should be used-->
                    <xs:element name="agreementCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <!--Product/Service to be used-->
                    <xs:element name="serviceCode" type="serviceType" minOccurs="0" maxOccurs="1" nillable="false" />
                    <!--Vehicle type to be used-->
                    <xs:element name="vehicleCode" type="vehicleType" minOccurs="0" maxOccurs="1" nillable="false"/> 
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="customer" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <!--Only used in internal OpterLink transfer-->
                    <xs:element name="customerGuid" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                     <!--Customer(payer) to be used when order is created-->
                    <xs:element name="customerCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                     <!--Customer(payer) to be used when order is created-->
                    <xs:element name="customerNumber" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="customerName" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                     <!--Only used if buyer is different than payer-->
                    <xs:element name="customerCodePurchaser" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                     <!--Only used if buyer is different than payer-->
                    <xs:element name="customerNumberPurchaser" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="customerNamePurchaser" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!-- All customer fields below are only used if customer is imported(messageType=customer) or if setting to auto create not already existing customer is turned on -->
                    <xs:element name="organizationNumber" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="invoiceReference" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="phoneNumber1" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="phoneNumber2" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="faxNumber" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="emailAddress" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="emailAddressInvoice" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="costPool" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="priceList" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="messageGroup" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="regionCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="querySetCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="orderAllowed" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="realCustomer" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="readyForInvoicing" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="readyForDispatching" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="notToBeInvoiced" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="paymentTerms" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="invoiceExport" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="address" minOccurs="0" maxOccurs="2">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="addressLine1" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="addressLine2" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="addressLine3" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="company" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="streetAddress" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="zipCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="city" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="state" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="country" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="countryCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="entreCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="info" type="string1024" minOccurs="0" maxOccurs="1" nillable="false" />
                        </xs:sequence>
                        <xs:attribute name="type" type="customerAddressType" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="customerReference" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="name" type="string50"  minOccurs="0" maxOccurs="1"  nillable="false"/>
                    <xs:element name="phoneNumber" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="mobilePhoneNumber" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="emailAddress" type="string255"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="password" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="internetUser" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="timesAndStatusInfo" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="status" type="status"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="statusDescription" type="string255"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="time" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="requestedTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="actualTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="earliestTime" type="xs:dateTime"  minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="latestTime" type="xs:dateTime"  minOccurs="0" maxOccurs="1" nillable="false"/>
                        </xs:sequence>
                        <xs:attribute name="type" type="notificationType" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="collectionFreight" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="selected" type="boolean"  minOccurs="1" maxOccurs="1" nillable="false"/>
                    <xs:element name="expectedFreights" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false"/>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="info" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="freightBillNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="customerProject" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="projectNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="sendersReference" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="receiversReference" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="sendersReferenceDate" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="goodsType" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="message" type="stringMax"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="extraMessage" type="stringMax"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="externalMessage" type="stringMax"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="sendersInstruction" type="stringMax"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="payer" type="payer"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="regionCode" type="region"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="trailCode" type="trail"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="querySetCode" type="querySet"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="timeFailureCode" type="timeFailureReason"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="timeFailureComment" type="string255"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="mainPodTypeCode" type="proofOfDeliveryType"  minOccurs="0" maxOccurs="1" nillable="false"/>                    
                    <xs:element name="extraId1" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="extraId2" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="extraId3" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="extraId4" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="extraId5" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="readyForInvoicing" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="readyForDispatching" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="notToBeInvoiced" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="notToBeCredited" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="nextWorkingDay" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="nextWorkingDayPickupDate" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="nextWorkingDayDeliveryDate" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="nextWorkingDayExtraDays" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="extraDays" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="extraDaysPickupDate" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="extraDaysDeliveryDate" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="resetOrderDateOnFirstScan" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="consolidateOnInscan" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="requireAddressUpdate" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="hideUntilScanned" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="orderData"  minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="transportDate" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="volume" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="area" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="loadMeter" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="weight" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="pricingWeight" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="packageCount" type="xs:int"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="timeMinutes" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="distanceKilometers" type="decimal186"  minOccurs="0" maxOccurs="1"  nillable="false"/>
                    <xs:element name="extraDimension1" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="extraDimension2" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="extraDimension3" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="extraDimension4" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="extraDimension5" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false"/>
					<xs:element name="co2EmissionForecast" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false"/>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="pricing"  minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="totalPrice" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="totalPriceExcludingFuelExtra" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="price" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="priceExcludingFuelExtra" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="fuelExtra" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="noFuelExtra" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="expense" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="description" type="string255"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="amount" type="decimal186" minOccurs="1" maxOccurs="1" nillable="false"/>
                          <xs:element name="tax" type="decimal186" minOccurs="1" maxOccurs="1" nillable="false"/>
                        </xs:sequence>
                        <xs:attribute name="type" type="expenseType" use="required" />
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="directExpense" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="description" type="string255"  minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="amount" type="decimal186" minOccurs="1" maxOccurs="1" nillable="false"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="extra" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="quantity" type="decimal186" default="1" minOccurs="1" maxOccurs="1" nillable="false"/>
                          <xs:element name="description" type="string1024"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="manualprice" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="price" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false"/>
                        </xs:sequence>
                        <xs:attribute name="type" type="extraType" use="required" />
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="priceitem" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="state" type="state"  minOccurs="0" maxOccurs="1" nillable="false" /> <!-- State is set to new by default -->
                          <xs:element name="internalId" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="externalId" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="externalGuid" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="description" type="string1024"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="extraId1" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="extraId2" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="extraId3" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="extraId4" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="extraId5" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="extraId6" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="extraId7" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="extraId8" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="materialsitename" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="materialsitecode" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="invoiceno" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="billno" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="resourceCode" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="quantity" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="unit1quantity" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="unit1name" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="unit2quantity" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="unit2name" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="unitprice" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="unitpriceresource" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="fixedprice" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="fixedpriceresource" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="discountamount" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="discountfactor" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="kickbackamount" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="kickbackfactor" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="contractorExpectedCost" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="contractorInvoiceNo" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="contractorInvoiceDate" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="contractorInvoiceDone" type="boolean" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="invoice" type="boolean" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="credit" type="boolean" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="noFuelExtra" type="boolean" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="noFuelExtraResource" type="boolean" minOccurs="0" maxOccurs="1" nillable="false" />
                        </xs:sequence>
                        <xs:attribute name="type" type="string50" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="cashOnDelivery" minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="bankAccountNumber" type="string50"  minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="paymentReference" type="string50"  minOccurs="1" maxOccurs="1" nillable="false"/>
                    <xs:element name="amount" type="decimal186"  minOccurs="1" maxOccurs="1" nillable="false"/>
                    <xs:element name="freight" type="decimal186" minOccurs="1" maxOccurs="1" nillable="false"/>
                    <xs:element name="fee" type="decimal186" minOccurs="1" maxOccurs="1" nillable="false"/>
                    <xs:element name="tax" type="decimal186"  minOccurs="1" maxOccurs="1" nillable="false"/>
                    <xs:element name="total" type="decimal186"  minOccurs="1" maxOccurs="1" nillable="false"/>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="extraGoodsData"  minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="product" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="quantity" type="xs:int" minOccurs="1" maxOccurs="1" nillable="false" />
                        </xs:sequence>
                        <xs:attribute name="type" type="product" use="required" />
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="option" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="selected" type="boolean" minOccurs="1" maxOccurs="1" nillable="false"/>
                          <xs:element name="completed" type="boolean" minOccurs="0" maxOccurs="1" nillable="false"/>
                        </xs:sequence>
                        <xs:attribute name="type" type="deliveryOption" use="required" />
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="capacity" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="quantity" type="xs:int"  minOccurs="1" maxOccurs="1" nillable="false"/>
                        </xs:sequence>
                        <xs:attribute name="type" type="capacityType" use="required" />
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="looseItem" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="startingQuantity" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="endingQuantity" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false" />
                        </xs:sequence>
                        <xs:attribute name="type" type="looseItemType" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="orderAddress" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="address" minOccurs="2" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="customerCode" type="string50" minOccurs="0" maxOccurs="1"  nillable="false"/>
                          <xs:element name="customerNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="name" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="company" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="streetAddress" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="addressLine2" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="addressLine3" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="zipCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="city" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="state" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="country" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="countryCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="hubCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="entreCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="phoneNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="faxNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="emailAddress" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="longitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="latitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="info" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                        </xs:sequence>
                        <xs:attribute name="type" type="addressType" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="shipment" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="sequenceNumber" type="xs:int" default="1"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="sortIndexFrom" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false" />          <!-- Only imported for messageType=updatesortorder -->
                    <xs:element name="sortIndexTo" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false" />            <!-- Only imported for messageType=updatesortorder -->
                    <xs:element name="status" type="status"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="statusDescription" type="string255"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="latest" type="boolean" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="resourceCode" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="secondaryResourceCode" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="subcontractorCode" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="driverCode" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="vehicleCode" type="string50"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="subcontractorResource" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="routeCode" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="routeName" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="routeDescription" type="string2048"  minOccurs="0" maxOccurs="1" nillable="false" />
					<xs:element name="routeSortingCode" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="shipmentDate" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>       
                    <xs:element name="pickupTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>         <!-- Obsolete. Use earliest/latest pickup time instead -->
                    <xs:element name="deliveryTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>       <!-- Obsolete. Use earliest/latest delivery time instead -->
                    <xs:element name="earliestPickupTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="latestPickupTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="earliestDeliveryTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="latestDeliveryTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="logPickupTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="logDeliveryTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="estimatedPickupTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/> 
                    <xs:element name="estimatedDeliveryTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="distanceKilometersCustomer" type="decimal186"  minOccurs="0" maxOccurs="1"  nillable="false"/>
                    <xs:element name="distanceKilometersResource" type="decimal186"  minOccurs="0" maxOccurs="1"  nillable="false"/>
					<xs:element name="emissionEstimate" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="resourcePrice" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="noFuelExtra" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="readyForDispatching" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="address" minOccurs="2" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="customerCode" type="string50" minOccurs="0" maxOccurs="1"  nillable="false"/>
                          <xs:element name="customerNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="name" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="company" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="streetAddress" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="addressLine2" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="addressLine3" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="zipCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="city" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="state" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="country" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="countryCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="hubCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="entreCode" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="phoneNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="faxNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="emailAddress" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="longitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="latitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="info" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="lock" minOccurs="0" maxOccurs="unbounded">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="state" type="state" minOccurs="0" maxOccurs="1"  nillable="false"/>         <!-- State is set to new by default -->
                                <xs:element name="appName" type="string50" minOccurs="1" maxOccurs="1"  nillable="false"/>
                                <xs:element name="lockName" type="string50" minOccurs="1" maxOccurs="1" nillable="false" />
                                <xs:element name="appDownloadUrl" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                                <xs:element name="param1" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                                <xs:element name="value1" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                                <xs:element name="param2" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                                <xs:element name="value2" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                                <xs:element name="param3" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                                <xs:element name="value3" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                          <xs:element name="serviceTime" minOccurs="0" maxOccurs="1">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element name="firstStopSeconds" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false" />
                                <xs:element name="additionalStopSeconds" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false" />
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                        <xs:attribute name="type" type="addressType" use="required" />
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="vehicle" minOccurs="0" maxOccurs="1">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="code" type="string50" minOccurs="0" maxOccurs="1"  nillable="false"/>
                          <xs:element name="name" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="registrationNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="driver" minOccurs="0" maxOccurs="1">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="code" type="string50" minOccurs="0" maxOccurs="1"  nillable="false"/>
                          <xs:element name="name" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="phoneNumber1" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="phoneNumber2" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="mobileNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="emailAddress" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="subcontractor" minOccurs="0" maxOccurs="1">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="code" type="string50" minOccurs="0" maxOccurs="1"  nillable="false"/>
                          <xs:element name="name" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="phoneNumber1" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="phoneNumber2" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="faxNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="emailAddress" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="workingsession" minOccurs="0" maxOccurs="1">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="phoneNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <!--External field not visible or needed in Opter but needed when exporting from Opter-->
                    <xs:element name="externalField" minOccurs="0" maxOccurs="unbounded" nillable="false">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="stringMax">
                            <xs:attribute name="name" type="string255" use="required"/>
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="notificationRequest" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="contactData" type="string50" minOccurs="0" maxOccurs="1" nillable="false"/> <!-- Use contactData for manual notification receiver -->
                    <xs:element name="attachFreightBill" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="attachPackageLabels" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                  </xs:sequence>
                  <xs:attribute name="contactMode" type="string50" use="required" />
                  <xs:attribute name="status" type="status" /> <!-- OBSOLETE - Use trigger + selection instead -->                  
                  <xs:attribute name="trigger" type="notificationTrigger" use="required" />
                  <xs:attribute name="selections" type="notificationSelection" use="optional" /> <!-- Selection is set to All if left empty. Use , to separate specific statuses, damage types, pod types or queryset codes -->
                  <xs:attribute name="receiver" type="notificationReceiver" use="optional" /> <!-- For automatic receiver logic, Default: Manual. ContactData can still be used as fallback-->                  
                </xs:complexType>
              </xs:element>
              <xs:element name="package" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="state" type="state"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="internalId" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="externalId" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="weight" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="volume" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="area" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="loadmeter" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="extraDimension1" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="extraDimension2" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="extraDimension3" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="extraDimension4" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="extraDimension5" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="width" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="height" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="depth" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="quantity" type="xs:int" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="packageId" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="text" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="packageType" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="goodsType" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="alertMessage" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="extraId1" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="extraId2" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="extraId3" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="extraId4" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="extraId5" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="stackable" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="syncActionTarget" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <!--External field not visible or needed in Opter but needed when exporting from Opter-->
                    <xs:element name="externalField" minOccurs="0" maxOccurs="unbounded" nillable="false">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="stringMax">
                            <xs:attribute name="name" type="string255" use="required"/>
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="dangerousGoods" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="unNumber" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="properShippingName" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="alternativeProperShippingName" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="class" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="subRiskClass" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="packingGroup" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="radionuclideSymbol" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="transportIndex" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="radioactiveClass" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="amount" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="unit" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="bqAmount" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="bqUnit" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />                  
                    <xs:element name="limitedQuantities" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="expectedQuantities" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="environmentalHazardous" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="radioactive" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="packageCount" type="xs:int"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="package" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="packageId" type="string50" minOccurs="1" maxOccurs="1"  nillable="false"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="packageScan" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="packageId" type="string50" minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="scanTime" type="xs:dateTime" minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="undoScanTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="hubCode" type="string50" minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="departure" type="boolean"  minOccurs="1" maxOccurs="1" nillable="false"/>
                    <xs:element name="undo" type="boolean"  minOccurs="1" maxOccurs="1" nillable="false"/>
                    <xs:element name="hasPod" type="boolean"  minOccurs="1" maxOccurs="1" nillable="false"/>
                    <xs:element name="latitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="longitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="comment" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="syncActionTarget" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                  </xs:sequence>
                  <xs:attribute name="type" type="scanType" use="required" />
                </xs:complexType>
              </xs:element>
              <xs:element name="freightBillScan" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="scanTime" type="xs:dateTime" minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="undoScanTime" type="xs:dateTime" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="hubCode" type="string50" minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="departure" type="boolean"  minOccurs="1" maxOccurs="1" nillable="false"/>
                    <xs:element name="undo" type="boolean"  minOccurs="1" maxOccurs="1" nillable="false"/>
                    <xs:element name="hasPod" type="boolean"  minOccurs="1" maxOccurs="1" nillable="false"/>
                    <xs:element name="latitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="longitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="comment" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="syncActionTarget" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                  </xs:sequence>
                  <xs:attribute name="type" type="scanType" use="required" />
                </xs:complexType>
              </xs:element>
              <xs:element name="proofOfDelivery" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="subCode" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="time" type="xs:dateTime"  minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="name" type="string50"  minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="comment" type="string255"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="extraComment" type="string1024"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="signature" type="xs:string"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="signatureCoordinatesBase64" type="xs:string"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="signatureImage" type="xs:string"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="signatureImageFileextension" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="url" type="string255"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="latitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="longitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="packageCount" type="xs:int"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="syncActionTarget" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="package" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="packageId" type="string50" minOccurs="1" maxOccurs="1"  nillable="false"/>
                          <xs:element name="hasScan" type="boolean"  minOccurs="1" maxOccurs="1" nillable="false"/>
                          <xs:element name="syncActionTarget" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="type" type="proofOfDeliveryType" use="required" />
                </xs:complexType>
              </xs:element>
              <xs:element name="damage" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="comment" type="string1024"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="measure" type="string1024"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="evaluationEffect" type="xs:string"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="eventName" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="reasonName" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="resourceCode" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="secondaryResourceCode" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="image" type="xs:string"  minOccurs="0" maxOccurs="1" nillable="false" />                <!-- Obsolete. Add attachment instead -->
                    <xs:element name="imageFileextension" type="string50"  minOccurs="0" maxOccurs="1" nillable="false" />    <!-- Obsolete. Add attachment instead -->
                    <xs:element name="imageUrl" type="string255"  minOccurs="0" maxOccurs="1" nillable="false" />             <!-- Obsolete. Add attachment instead -->
                    <xs:element name="value" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="payedAmount" type="decimal186"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="latitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="longitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                    <xs:element name="completed" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="syncActionTarget" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                    <xs:element name="package" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="packageId" type="string50" minOccurs="1" maxOccurs="1"  nillable="false"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="attachment" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="fileName" type="string50" minOccurs="1" maxOccurs="1"  nillable="false"/>
                          <xs:element name="fileExtension" type="string50" minOccurs="1" maxOccurs="1" nillable="false" />
                          <xs:element name="comment" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="data" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="textData" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="url" type="string255"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="freightBillNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="packageId" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="guid" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="noExport" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="showOnWeb" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="includeWithInvoice" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="type" type="damageType" use="required" />
                </xs:complexType>
              </xs:element>
              <xs:element name="position" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="vehicleId" minOccurs="0" maxOccurs="1" nillable="false">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="string50">
                            <xs:attribute name="type" type="resourceIdType"/>
                            <xs:attribute name="findActiveWorkingSession" type="boolean"/>
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="driverId" minOccurs="0" maxOccurs="1" nillable="false">
                      <xs:complexType>
                        <xs:simpleContent>
                          <xs:extension base="string50">
                            <xs:attribute name="type" type="resourceIdType"/>
                            <xs:attribute name="findActiveWorkingSession" type="boolean"/>
                          </xs:extension>
                        </xs:simpleContent>
                      </xs:complexType>
                    </xs:element>
                    <xs:element name="time" type="xs:dateTime"  minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="latitude" type="decimal186" minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="longitude" type="decimal186" minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="speed" type="decimal62"  minOccurs="0" maxOccurs="1" nillable="false" />
                   </xs:sequence>
                  </xs:complexType>
              </xs:element>
              <xs:element name="document"  minOccurs="0" maxOccurs="1">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="attachment" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="fileName" type="string50" minOccurs="1" maxOccurs="1"  nillable="false"/>
                          <xs:element name="fileExtension" type="string50" minOccurs="1" maxOccurs="1" nillable="false" />
                          <xs:element name="comment" type="string255" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="data" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="textData" type="xs:string" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="url" type="string255"  minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="freightBillNumber" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="packageId" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="guid" type="string50" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="noExport" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="showOnWeb" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                          <xs:element name="includeWithInvoice" type="boolean"  minOccurs="0" maxOccurs="1" nillable="false"/>
                        </xs:sequence>
                        <xs:attribute name="type" type="attachmentType" use="required" />
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                </xs:complexType>
              </xs:element>
              <xs:element name="externalCredit"  minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="number" type="string50" minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="date" type="xs:dateTime" minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="amount" type="decimal186" minOccurs="1" maxOccurs="1" nillable="false" />
                    <xs:element name="externalResourceCreditingUnitId" type="xs:int" minOccurs="0" maxOccurs="1"  nillable="false"/>     
                  </xs:sequence>                       
                </xs:complexType>
              </xs:element>
              <!-- External field not visible or needed in Opter but needed when exporting from Opter to external system -->
              <xs:element name="externalField" minOccurs="0" maxOccurs="unbounded" nillable="false">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="stringMax">
                      <xs:attribute name="name" type="string255" use="required"/>
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <!-- Queries imported when new order/shipment is imported -->
              <!-- Replies imported when status or pod is imported -->
              <xs:element name="query" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="internalId" type="string50" minOccurs="0" maxOccurs="1" nillable="false" /> <!-- Mandatory when query and new order is imported and created to be able to later match imported replies with existing query -->
                    <xs:element name="externalId" type="string50" minOccurs="0" maxOccurs="1" nillable="false" /> <!-- Mandatory when reply is imported to be able to match reply with existing query -->
                    <xs:element name="reply" minOccurs="0" maxOccurs="unbounded">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="booleanAnswer" type="boolean" minOccurs="0" maxOccurs="1"  nillable="false"/> <!-- Mandatory when query setting BooleanAnswer=true -->
                          <xs:element name="stringAnswer" type="string255" minOccurs="0" maxOccurs="1"  nillable="false"/> <!-- Mandatory when query setting BooleanAnswer=false -->
                          <xs:element name="latitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="longitude" type="decimal186" minOccurs="0" maxOccurs="1" nillable="false" />
                          <xs:element name="time" type="xs:dateTime" minOccurs="0" maxOccurs="1"  nillable="false"/>  <!-- Set create time to avoid importing duplicate replies with same time -->
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="type" type="query" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="id" type="string50" use="required" />
      <xs:attribute name="version" type="decimal186" use="required" />
    </xs:complexType>
  </xs:element>
</xs:schema>