Ive trying to make a iso8583 pakage with j8583 library to replace and old iso8583 program we have running ( i dont have the source code) . The packet generated its different than the packet generated by the old software. note the "f" in the old package.
the code
messageFactory.setAssignDate(false);
messageFactory.setUseBinaryMessages(true);
IsoMessage isoMessage = messageFactory.newMessage(0x1804);
isoMessage.setBinary(true);
isoMessage.setBinaryBitmap(true);
isoMessage.setValue(3, "000000", IsoType.NUMERIC, 6);
isoMessage.setValue(11, "000001", IsoType.NUMERIC, 6);
isoMessage.setValue(12, "151021095555", IsoType.NUMERIC, 12);
isoMessage.setValue(24, "831", IsoType.NUMERIC, 3);
isoMessage.setValue(25, "8700", IsoType.NUMERIC, 4);
isoMessage.write(outputStream, 2);
Old package
0x0000: 0a13 ad7c d6d0 0a2f 6a3b 8f1e 0800 4500 ...|.../j;....E.
0x0010: 0055 73ae 4000 4006 41de 0a00 0888 94ab .Us.@.@.A.......
0x0020: dde3 b88b 540c c290 a52c 976a 3432 5018 ....T....,.j42P.
0x0030: 01c9 855e 0000 002d f1f8 f0f4 2030 0180 ...^...-.....0..
0x0040: 0000 0000 f0f0 f0f0 f0f0 f1f5 f3f0 f2f9 ................
0x0050: f1f5 f1f0 f2f0 f2f1 f1f1 f3f1 f8f3 f1f8 ................
0x0060: f7f0 f0
new package
0x0000: 0a13 ad7c d6d0 0a2f 6a3b 8f1e 0800 4500 ...|.../j;....E.
0x0010: 0042 39a7 4000 4006 7bf8 0a00 0888 94ab .B9.@.@.{.......
0x0020: dde3 bcce 540c b124 15aa 1a6e e56b 5018 ....T..$...n.kP.
0x0030: 01c9 854b 0000 1804 2030 0180 0000 0000 ...K.....0......
0x0040: 0000 0000 0001 1510 2109 5555 0831 8700 ........!.UU.1..
1) In old data package example you can see bytes with 'F'. It is clearly show that the encoding of data in EBCDIC format.
2) In New package, the fields are BCD packed - The numeric fields used half of byte per digit.
For sample, from your binary data:
f1f8 f0f4
" - MTI encoded as EBCDIC 1804
" - MTI encoded as BCD Change you fields encoding mode (if your java lib supported this option).
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.