The XML print request structure is the most common method for sending EPP Web Service print requests and the only method used for the EPP Socket Listener agent*, but also supported with the EPP File Drop agent.
XML print requests allow multiple AND different label templates to be referenced in a single print request body; but only supports defining a single printer destination.
A single XML print request will result in a single EPP print job created, whether the XML body contains one or multiple ‘label’ definitions.
XML Print Request Components
-
XML header: Required, first 2 parts of XML body.
-
Details the xml version, encoding, and standalone parameters as well as doctype config.
-
Every EPP XML print request should include this.
-
-
‘labels’: The parent container for all label sections.
-
_FORMAT: Label Template (Format) Name. Required and case sensitive.
-
_PRINTERNAME: Name of print destination. Required and case sensitive.
-
_QUANTITY: Number of label copies. Required.
-
Only one ‘labels’ portion can be in the XML request
-
Controls which single printer destination the label(s) will be routed to
-
-
‘label’: Child container for individual label definitions
-
_FORMAT: Label Template (Format) Name
-
_PRINTERNAME: Optional and case sensitive.
-
_QUANTITY: Number of label copies
-
Contains variable string assignments to be used in generated label output
-
-
‘variable’: Value assignments for variables used in the referenced EPP label template.
-
The ‘name’ attribute defines the variables used in the label template design
-
All EPP Data Dictionary item types will be defined this way; not just VARIABLE items.
-
Passing an empty variable assignment can be done in three ways, using either example below or simply not defining the variable in the print request.
-
<variable name="sample1"></variable> -
<variable name="sample2"/>
-
-
Variable values need to be XML compatible, so some characters require escape codes:
Character Encoding > >< <& &“ "‘ '
-
Examples:
Below example includes two labels, for one printer:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE labels SYSTEM "dsi-label.dtd">
<labels _FORMAT="#Samples\Sample.lbl" _PRINTERNAME="defaultSite#FauxPrinter" QUANTITY="1">
<label _FORMAT="#Samples\Sample.lbl" _PRINTERNAME="defaultSite#FauxPrinter" _QUANTITY="1">
<variable name="CustomerName">Arthur Dent</variable>
<variable name="CustomerNumber">29</variable>
<variable name="ItemDescription">Don't Panic</variable>
<variable name="ItemNumber">42</variable>
<variable name="OrderDate">2005/04/29</variable>
<variable name="OrderNumber">123</variable>
</label>
<label _FORMAT="#Samples\Warehouse\Shipping.laser.lbl" _QUANTITY="1">
<variable name="CUSTOMER">Emmett Brown</variable>
<variable name="ORGANIZATION">B2TF</variable>
<variable name="SHIP_FROM1">ABCDE12345ABCDE12345ABCDE12345</variable>
<variable name="SHIP_FROM2">ABCDE12345ABCDE12345ABCDE12345</variable>
<variable name="SHIP_FROM3"/>
<variable name="SHIP_FROM4"/>
<variable name="SHIP_FROM_STATE">AA</variable>
<variable name="SHIP_FROM_ZIP">99999</variable>
<variable name="SHIP_TO1">ABCDE12345ABCDE12345ABCDE12345</variable>
<variable name="SHIP_TO2">ABCDE12345ABCDE12345ABCDE12345</variable>
<variable name="SHIP_TO3"/>
<variable name="SHIP_TO4"/>
<variable name="SHIP_TO_STATE">AA</variable>
<variable name="SHIP_TO_ZIP">19850</variable>
<variable name="TOTAL_LPN">121g-88-1985</variable>
</label>
</labels>
* The EPP Socket Listener agent is an optional feature that can be enabled in the ‘Admin > System Configuration’ page. The Socket Listener is not related to the EPP SOCKET printer communications but is a connection point for Oracle systems to send print requests to the EPP server, via defined port and XML print request data.