简体   繁体   English

如何用J8583解析十六进制ISO8583消息?

[英]How to parse hex ISO8583 message with J8583?

I have tried different ways but they were not useful. 我尝试了不同的方法,但是它们没有用。

//parsing data from config file
messageFactory = ConfigParser.createFromClasspathConfig(CONFIG_FILE_PATH);
//messageFactory.setForceStringEncoding(true);
//messageFactory.setCharacterEncoding("utf-8");

IsoMessage incomingMessage = messageFactory.parseMessage(data, NetworkInterfaceConfiguration.MESSAGE_HEADER_LENGTH);

When you say hex, do you mean binary? 当您说十六进制时,您的意思是二进制吗? If so, you need to set the message factory to use binary messages. 如果是这样,则需要将消息工厂设置为使用二进制消息。 This means it will expect the message type to be in the first 2 bytes, then the primary bitmap in the next 8 bytes, secondary (if any) in the next 8 bytes, etc. 这意味着它将期望消息类型在前2个字节中,然后是主要位图在接下来的8个字节中,在次要(如果有的话)在接下来的8个字节中,等等。

By default it's not set to read/write binary messages. 默认情况下,未将其设置为读取/写入二进制消息。

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

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