The content of the actual encoding description is structured in well known "ini-file" format. The section [Fields]
contains the links between encoding fields and exchanged database fields.
This is a typical example for a description file:
CODE
[Encoding]
Type=2,Magstripe
SubType=1
[Fields]
Track 2=Field21
[Description]
Applicationlist=2
[Application_2]
Name=ISO
DescVer=2,0,0
Format=ISO
Coerc=HiCo
Track=2
ADR_00000=Track 2,Track 2,X,,,S
With regard to the initial topic of replicating the functionality of the EncodingConfigurator by your own application, you can actually create a BASE64 encoded data element (as exchanged in the XMLs) by following these steps:
- Read a dsc file's content from disk.
- Assign encoding fields to database fields by entering the database field name at the right side of the equal sign inside the
Fields
section. - Pack the resulting dsc file content by using the zip algorithm.
- Encode the zip file by using the BASE64 algorithm. The resulting BASE64 string is used as encoding description value in the requests XML.
As this is an administrative topic which is often only done once, it may even be appropriate to do step 1-3 manually by using any text editor and zip packer tool.
In general, note the following when modifying description files:
- Only change section
Fields
when editing the encoding description and leave all other lines unchanged. - The right part of an encoding field assignment contains either:
A database field name, for example:
CODE
EncodingNumber=Field21
A fix value in which the actual value is in quotation marks, for example:
CODE
EncodingNumber="1234"
A formatted field to extend a value to a defined count of characters (typically to get numbers with leading zeros), for example:
CODE
EncodingNumber=Format(Field21,"000000")
A concatenated value, consisting any combination of above named elements, for example:
CODE
EncodingNumber="000" + Field22 + Format(Field21,"000000")
In most cases, using a single field or a fix value is appropriate and recommended! Concatenation and especially the formatting is only rarely used and should only be applied if really necessary. It is virtually exclusively used in combination with magnetic stripe encodings as they typically expose one field per track. And such a track's content is usually built from different database fields.
You may find partially encrypted encoding description files like the following example. In such cases, take care, only to change section Fields
and not the lines starting with a circumflex sign (^).
CODE
^FE072AAC0CD2D09938648E735DD4096028D15DFCC825BE6753D0F04E267A5BF6
^217EEBE0D49152DED5322DD49FB51FEAB66B0413FEFF3A1E79C91E9AE517300B
^46C820E6DBF0C328B5A1835BC2D32CFFF3E7440102BEA98AD2BB0B210CC0CD7E
[Fields]
Track 2=Field21
^62C7375932516D9538648E735DD40960A13B8412891D86281EAE17D49301400A
^359564A93274A595DCEEBD51B3D8DC75E1C59A72D38669B0516D264BD2BB0B210CC0CD7E
^4E40A6EE2BCD5D0D38648E735DD40960A5A238D5EAE86E017C05E745FBF80DC2
^62F8B4AD22C0EE4B67CBB5F0210702326FFA8F79235B997C
^0A8EF2864BC8B6E71995AC1C675B3730E9C8EFA52E7AEE2656209EC899C3F708
^24CC50220135BF4FB309827FEE2B58B0E3D6437093FBBE71100D9CDD52AFCEBB
^17D7C1EACA0EF371E8973E35E97EC9271C44B1D95085F1EEAFBB30917D25DFFA
^C777F5F1293C268DD5322DD49FB51FEA8C6CF4D1C259580A
^CD27B18620EF224F9D2C4A584D9627D173AA7898580D94B50499