简体   繁体   English

打包iso8583消息

[英]Pack iso8583 message

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) . 我试图用j8583库制作一个iso8583包,以替换和我们运行的旧iso8583程序(我没有源代码)。 The packet generated its different than the packet generated by the old software. 数据包生成的包与旧软件生成的包不同。 note the "f" in the old package. 注意旧软件包中的“ f”。

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'. 1)在旧的数据包示例中,您可以看到带有'F'的字节。 It is clearly show that the encoding of data in EBCDIC format. 清楚地显示了EBCDIC格式的数据编码。

2) In New package, the fields are BCD packed - The numeric fields used half of byte per digit. 2)在新程序包中,这些字段是BCD打包的-数字字段每位使用一半字节。

For sample, from your binary data: 例如,从您的二进制数据中:

  • Old 0x" f1f8 f0f4 " - MTI encoded as EBCDIC 旧的0x“ f1f8 f0f4f1f8 f0f4编码为EBCDIC
  • New 0x" 1804 " - MTI encoded as BCD 新的0x“ 1804 ”-MTI编码为BCD

Change you fields encoding mode (if your java lib supported this option). 更改您的字段编码模式(如果您的Java库支持此选项)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM