Reputation: 23
I am using jPOS for creating ISO8583 message, I am using the genericpackager but it seems it only support data fields of fixed length. I want to prepend the length of the field before the field if it has a variable size. I am using below:
<isofield
id="34"
length="32"
name="Extended Primary Account Number"
class="org.jpos.iso.IF_CHAR"/>
and in .java fileisoMsg.set(34, "12345ABCDE");
What change do I need to make to prepend the length of the field before the field.
Upvotes: 1
Views: 1687
Reputation: 131
For each isofield - you need to modify the class to match the requirements for the appropriate field configuration.
http://jpos.org/doc/javadoc/org/jpos/iso/packager/GenericPackager.html
For instance you can use any of the isofield classes with a Length indicator (L) such as:
class="org.jpos.iso.IFA_LLCHAR"/>
Or
class="org.jpos.iso.IFB_LLNUM"/>
to support a variable length field.
Where the first example is ASCII 2 byte Length and the second one is Binary 2 byte Length.
you can find a list of sample generic packagers here: https://github.com/jpos/jPOS/tree/master/jpos/src/dist/cfg/packager
you can find a list of isofield classes (start with IF_) here: https://github.com/jpos/jPOS/tree/master/jpos/src/main/java/org/jpos/iso
Upvotes: 3