vikrantlabde / iso8583-Java

iso8583 Message Pack & Unpack lib for Java. Works well with Android
57 stars 54 forks source link

Problems parsing some isoMessage #2

Open halbano opened 9 years ago

halbano commented 9 years ago

Hi all,

I've download the code and after some modification i'm parsing almost fine my fields.... I defined the schema like this:

ISOSCHEMA.put("1","BITMAP"); ISOSCHEMA.put("2","NUM-2-19-0_0"); ISOSCHEMA.put("3","NUMERIC-0-6-0_0"); ISOSCHEMA.put("4","NUMERIC-0-12-0_0"); ISOSCHEMA.put("7","NUMERIC-0-10-0_0"); ISOSCHEMA.put("11","NUMERIC-0-6-0_0"); ISOSCHEMA.put("12","NUMERIC-0-6-0_0"); ISOSCHEMA.put("13","NUMERIC-0-4-0_0"); ISOSCHEMA.put("22","NUMERIC-0-3-0_0"); ISOSCHEMA.put("23","NUMERIC-0-3-0_0"); ISOSCHEMA.put("35","NUM-2-37-0_0"); ISOSCHEMA.put("41","FCHAR-0-8-0_0"); ISOSCHEMA.put("49","FCHAR-0-3-0_0"); ISOSCHEMA.put("55","NUM-3-999-0_0"); // I have some doubts here??

The problem now is the field 55 that is a binary field:

55 Reserved ISO B 255 LLLVAR (ISO DOCUMENTATION)

I'm having an error parsing a string that has the bitmap on on the field 55.

I'm having from the output: 820200409F36020004950500000000009A031409039C01005F2A020..978..9F02060000000005009F03060000000000009F10201F430200200000000000000000045895000000000000000000000000000000009F260840D26C4BA5577CFB9F2701809F370443DD7E879F1A0202509F3303E0B0C8

But I expect: 820200409F36020004950500000000009A031409039C01005F2A020..124..9F02060000000005009F03060000000000009F10201F430200200000000000000000045895000000000000000000000000000000009F260840D26C4BA5577CFB9F2701809F370443DD7E879F1A0202509F3303E0B0C8

I leave the difference between dots, for easily visualization. The length of the iso payload converted is highly different too...

The program output is: 303130307238060020C280C28200313636353433323131313232333334343535303030303030303030303030303030303031313031363138333432363030323339343133333433303130313630373130303133373635343332313131323233333434353564333131303232303030393238333030313031303238343031373430393132343233303832303230303430394633363032303030343935303530303030303030303030394130333134303930333943303130303546324130323039373839463032303630303030303030303035303039463033303630303030303030303030303039463130323031463433303230303230303030303030303030303030303030303034353839353030303030303030303030303030303030303030303030303030303030303030394632363038343044323643344241353537374346423946323730313830394633373034343344443745383739463141303230323530394633333033453042304338

What I expect is: 30313030723806002080820031363635343332313131323233333434353530303030303030303030303030303030303131303136313833343236303032333934313333343330313031363037313030313337363534333231313132323333343435353D33313130323230303039323833303031303130323834303137343039313234313135820200409F36020004950500000000009A031409039C01005F2A0201249F02060000000005009F03060000000000009F10201F430200200000000000000000045895000000000000000000000000000000009F260840D26C4BA5577CFB9F2701809F370443DD7E879F1A0202509F3303E0B0C8

One advice is: I have to make the explicit conversion to hex from the resultant byte[] and viceversa. It is: String isoMessage = ISOUtil.hexString(packIsoMsg("0100", isofields).getBytes()); And: unpackIsoMsg(new String(ISOUtil.hex2byte(isoMessage), "UTF-8"));

What about the definition of this kind of fields in this class? I'm really a newbie with the standard but I arrived here because jpos doesn't work in an Android environment. Also I'm confused with the last mentioned conversion to hex.

Any help is really appreciated... Kind regards.

kahwooi commented 6 years ago

Hi @halbano did you solve the problem?