Hello,
We are processing Custom message processing with 1 Byte Bitmap where left most digit represents presence of data element.
We created this xml:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE isopackager SYSTEM "genericpackager.dtd">
<isopackager>
<isofield
id="0"
length="4"
name="MESSAGE TYPE INDICATOR"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="1"
length="1"
name="BIT MAP"
class="org.jpos.iso.IFA_BITMAP"/>
<isofield
id="2"
length="19"
name="PAN"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="3"
length="4"
name="DATE, EXPIRATION"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="4"
length="10"
name="AMOUNT, TRANSACTION"
pad="true"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="5"
length="2"
name="RESPONSE CODE"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="6"
length="80"
name="CARD HOLDER NAME"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="7"
length="5"
name="ZIPCODE"
class="org.jpos.iso.IFA_NUMERIC"/>
</isopackager>
We used Generic Packager and It's not able to identify all the fields that are present in the message as left most bit is not used for data element presence with IFA_BITMAP.
Then we changed BITMAP class to this class org.jpos.iso.packager.Base1_BITMAP126
Now we get this parsing error:
Message = 0100e016567878911145111102260000001000
java.lang.Exception: org.jpos.iso.ISOException: org.jpos.iso.IFA_LLCHAR: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 78 too long. Max: 19) unpacking field=2, consumed=12
at com.highnote.prompt.Checkjpos.parseISOMessage(Checkjpos.java:35)
at com.highnote.prompt.Checkjpos.main(Checkjpos.java:13)
Caused by: org.jpos.iso.ISOException: org.jpos.iso.IFA_LLCHAR: Problem unpacking field 2 (org.jpos.iso.ISOException: Field length 78 too long. Max: 19) unpacking field=2, consumed=12
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:341)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:479)
at com.highnote.prompt.Checkjpos.parseISOMessage(Checkjpos.java:32)
... 1 more
This our parser method:
private ISOMsg parseISOMessage() throws Exception {
String message = "0100e016567878911145111102260000001000";
//String message = "0100ec1651051051051051001225000001100011MASTER YODA90089";
System.out.printf("Message = %s%n", message);
try {
// Load package from resources directory.
InputStream is = getClass().getResourceAsStream("/simpleMessageFields.xml");
GenericPackager packager = new GenericPackager(is);
//Base1SubFieldPackager packager = new Base1SubFieldPackager();
ISOMsg isoMsg = new ISOMsg();
isoMsg.setPackager(packager);
isoMsg.unpack(message.getBytes());
return isoMsg;
} catch (ISOException e) {
throw new Exception(e);
}
}
Any suggestions on what BitMap class to use an dwhat packager to use in this scenario