This article describes the card's XML representation. All requests use this definition (or elements of it) in its basic form. Depending on the request, the definition slightly varies. Furthermore, the XML representation is an excellent approach to understand the parts of the card and how they fit together. Code Block |
---|
language | xml |
---|
title | Basic XML definition of a card |
---|
collapse | true |
---|
| <?xml version="1.0"?>
<card>
<applications>
</applications>
<fields>
</fields>
<preview/>
</card> |
Code Block |
---|
language | xml |
---|
title | Non managed mode, XML example |
---|
collapse | true |
---|
| <?xml version="1.0"?>
<card name="Employee Card">
<applications>
<front name="Employee Layout">WBusGwIAvwI...IAAQA=</front>
<magstripe name="Door Controller">UEsA...ADgAA=</magstripe>
</applications>
<fields>
<text name="Field01" text="Name"></text>
<text name="Field02" text="First Name"></text>
<text name="Field21" text="Card Number"></text>
<text name="Field22" text="Card Version"></text>
<photo name="Field01"></photo>
<signature name="Field01"></signature>
</fields>
<preview front_data="" back_data=""
max_width="400" max_height="400"
format="png"/>
</card> |
Code Block |
---|
language | xml |
---|
title | Managed mode, XML example |
---|
collapse | true |
---|
| <?xml version="1.0"?>
<card name="Employee Card" managed_mode="true">
<applications>
<front/>
<magstripe/>
</applications>
<fields>
<text name="Field01" text="Name"></text>
<text name="Field02" text="First Name"></text>
<text name="Field21" text="Card Number"></text>
<text name="Field22" text="Card Version"></text>
<photo name="Field01"></photo>
<signature name="Field01"></signature>
</fields>
<preview front_data="" back_data=""
max_width="400" max_height="400"
format="png"/>
</card> |
These are the differences between the definition in Non managed mode and Managed mode: - In Non managed mode, all layout and all encoding data is directly contained in the definition.
- In Managed mode, all layout and all encoding data is referenced by the name of the card that is defined by the CardDesigner in its card table. Therefore, there is no value for an application's element. The mode itself is defined by the attribute
managed_mode="true" .
The definition represents a card type. Enriched with field values it represents a person's card to be produced. It is then sent (with further minor extensions) to the corresponding web service request to create a card job or to create a card preview. In other articles is described how to refine this basic definition especially with focus on the requests for: - Defining a single card in Non managed mode using the
CardDesigner /EncodingConfigurator or CardComposer request - Defining all cards in Managed mode using the
CardDesigner request - Creating a card preview using the
CardPreview request - Creating a card job using the
CardJob request
Requests in detailElement | Attribute | Description |
---|
card
Root element for the card definition. | name
| Name of the card. - In Non managed mode, input and output value from the
CardComposer request. It is intended to be used as a descriptive text and reference when storing the definition in your database (for example, "Employee Card", "Guest Card", ...) - In Managed mode, required input value for the
CardPreview and CardJob requests. It references the card in the CardDesigner's card type table.
| card/applications
Element containing all applications which describe the card. Applications are the card's front and back and chip encodings. - In Non managed mode, this element is input for and output from the
CardComposer . - The element is always required input for the
CardPreview and CardJob requests.
| - | - | card/applications/‹application›
‹application› {front,back,magstripe,chip,mifare,
legic,hitag,proxif,uhf} 1,2
An application of the card. front and back are the card's visual descriptions defined as layouts. All other values are encodings, described by encoding descriptions.
magstripe is a magnetic stripe encoding, chip stands for a contact chip encoding, all other encodings are proximity encodings.
- In Non managed mode, optional input and returned output from the
CardComposer request. It is required input for the CardPreview and CardJob requests. - In Managed mode, only the element itself is required and input for the
CardPreview and CardJob request. The actual value is defined by the corresponding card in the CardDesigner's card table.
For production, a corresponding device must be configured by the Configuration Manager. For the card's front and back a card printer, for an encoding (magstripe, chip, mifare, legic, hitag, proxif, uhf) a corresponding encoding device. 1mifare also includes ICODE encoding descriptions. 2hitag also includes EM4102 encoding descriptions. | name | The name of an application. - In Non managed mode, it is the name of a layout or encoding description, generated and used by the CardComposer. It is only descriptive but it may be very practical, as it describes an encoding with a name like "Magstripe Door Controller".
- In Managed mode, there is no real application for this attribute and is therefore without meaning. However, there is only one exception using the
Cards request: This request returns all defined cards and their applications as defined by the CardDesigner. And these applications application elements do return a name. It describes the application for information purposes. See heading "Retrieve cards" for details.
| card/fields
fields contains all fields which are used as dynamic values in layouts and encoding descriptions.
- In Non managed mode, the list is completely free to be defined by you. Do not change (reduce) the list after using it with
CardComposer , CardDesigner or EncodingConfigurator . The reason is that the fields may have be referenced and stored within layouts and encoding descriptions. - In Managed mode, the list is predefined. It is used and managed by the CardDesigner. You may retrieve it by the
Fields request. See heading "Retrieve fields".
Fields is always a required element for a CardComposer , CardDesigner , EncodingConfigurator , CardPreview and CardJob requests.
Note |
---|
The field list is intended to correspond to the list of relevant fields of your table or view in your database: Designing a layout, the user has an immediate perception to select one of "his" fields to print it on the card. Using encoding descriptions, the user makes a link of "his" field to an encoding field on the chip. For this reason, the fields are named as Database Fields when shown in any SDK's user interface. |
| - | - | card/fields/‹fieldtype›
‹fieldtype› {text,photo,signature,fingerprint}
Field element of one of the four available types. text is a textual field and contains an UTF8 encoded string. All other types transport BASE64 encoded binary (image) data. | name | The logical name of the field which has to be unique for each field type. However, field names from different field types may overlap. For example, it may exist a text field "Field01" but alsoa photo field "Field01". | text | The textual name of a field. Used in Non managed mode for the CardDesigner , EncodingConfigurator and CardComposer requests. Textual values are used when a field is displayed in any user interface. This allows the use of translated field names. For example, "Card Number" in English and "Ausweisnummer" in German, but always addressing the same logical field. When no text attribute is provided, the interface uses the value of the name attribute. However, a field reference in a layout or in an encoding description will always store the logical field name. | card/preview
Preview element which holds a card's front and back preview. It is an optional input value used for the CardComposer , CardJob and CardPreview requests to control card preview generation. The detailed behavior is controlled by its attributes.
| front_data | Using the CardComposer , CardJob and CardPreview requests, an existing empty data attribute (front_data =””) instructs the component to return the card preview image BASE64 encoded. In this case, the returned XML contains the BASE64 encoded image data as the attribute's value. | back_data | Same as front_data but for card back. | front_image | If this attribute is provided, it instructs the SDK to create a card preview image on the web service, retrievable via an HTTP GET request. In the request, you may either provide an empty value (image =””) or a name of the image object (for example, image =”front.png”). In the response and if an empty value was provided, the attribute's value does contain a generated unique name (for example, image =”front15.png”). Or, if a value was provided, the same value is returned. In both cases, the preview image is available using a URL like http://localhost:54880/front15.png to retrieve the image. The typical case of application is to provide a preview image within an HTML page via an HTML img tag. The image is retrievable as long as the service is running or an HTTP DELETE request for this image is done (always use the complete URL like http://localhost:54880/front15.png with GET or DELETE). The web service's list is also limited to 100 images. If more images are requested, the ones created first are deleted (realizing a FIFO principle). | back_image | Same as front_image but for card back. | max_width
max_height
| Values describing the maximal size of the returned card preview images. The aspect ratio of the card is always kept. In other words: The returned image is scaled that it fits into a rectangle defined by these values. The values unit is pixel. | format | Describes the format of the returned card image. Possible values are png, jpg, bmp, tif or jp2. The recommended format is png. The reason is that returned card images contain rounded corners and the area between card corners and image boundary is returned transparent. This is only supported by png. If other formats are used the area is filled with white color. |
|