简体   繁体   English

ISO8583 解包问题

[英]ISO8583 Unpack Issue

How I will unpack ISO message using JPOS library in java?如何使用 java 中的 JPOS 库解压 ISO 消息?

here is the sample ISO message.这是示例 ISO 消息。

0800. ..............1224190516424997001003      
Sample Hex Dump:
30 38 30 30 82 20 01 00  00 00 00 00 04 00 00 00      0800. ..........
00 00 00 00 31 32 32 34  31 39 30 35 31 36 34 32      ....122419051642
34 39 39 37 30 30 31 30  30 33                        4997001003    

Please note that I have packed this above message using jpos library and bit map format is org.jpos.iso.IFB_BITMAP请注意,我已经使用 jpos 库和位 map 打包了上述消息,格式为 org.jpos.iso.IFB_BITMAP

If you want to unpack from the data you shared, you just need to use the same packager you used to pack the iso message to unpack what you generated.如果你想从你共享的数据中解包,你只需要使用你用来打包 iso 消息的同一个打包器来解包你生成的内容。

You can instantiate a packager with the same parameters you used to pack the message and then:您可以使用用于打包消息的相同参数来实例化打包程序,然后:

ISOPackager pacakger = ....; //initialize the same way as used to pack
ISOMsg m = new ISOMsg();
//here we are using the hexdump since the plain data has non printable chars, because of the binary bitmap
byte[] packed = ISOUtil.decodeHexDump(
                "30 38 30 30 82 20 01 00  00 00 00 00 04 00 00 00      0800. ..........\n" +
                "00 00 00 00 31 32 32 34  31 39 30 35 31 36 34 32      ....122419051642\n" +
                "34 39 39 37 30 30 31 30  30 33                        4997001003");
packager.unpack(m, packed);

Alternatively you can或者,您可以

ISOMsg m = new ISOMsg();
m.setPackager(packager);
m.unpack(packed);

Provided that packed and packager variables are initialized in the ssame way as above.前提是packedpackager变量的初始化方式与上述相同。

And you will have the iso message content in the m variable.您将在m变量中拥有 iso 消息内容。

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

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