Hello,
A trying to sen a binary iso header like a documentation shown, the message show the next output:
My TPDU string is next: 6000050000, when i set de property setBinaryIsoHeader on my IsoMessage, the output show the TPDU like that:
[0x36303030303530303030]
this only printed by debugString method in IsoMessage Class
All Message: [0x36303030303530303030]08002220010000C0001099000008261337000014841127202409203659307 0004OPv1
this message almost are correctly encoded... but there is a way to encode binary iso header in bytes without hexadecimal encodig?
This is because when i send the message to the server the TPDU is encoded in hex:
0: 3630 3030 3035 3030 3030 0800 2220 0100 [6000050000.." ..] 16: 00C0 0010 9900 0008 2609 2500 0032 9701 [........&.%..2..] 32: 1237 3230 3234 3039 3230 3336 3539 3330 [.720240920365930] 48: 3720 2020 2020 2020 0004 4F50 7631 0040 [7 ..OPv1.@]
And the correct way will be something like this:
0: 6000 0500 0008 0022 2001 0000 C000 1099 [`...............] 16: 0000 0826 0925 0000 3297 0112 3732 3032 [........&.%..2..] 32: 3430 3932 3033 3635 3933 3037 2020 2020 [.720240920365930] 48: 2020 2000 044F 5076 3100 [7 ..OPv1.@]
My factory configuration:
messageFactory.setAssignDate(true); messageFactory.setTraceNumberGenerator( new SimpleTraceGenerator((int) (System .currentTimeMillis() % 10000))); messageFactory.setUseBinaryMessages(true); messageFactory.setUseBinaryBitmap(true); messageFactory.setBinaryFields(true); messageFactory.setBinaryHeader(false);
IsoMessage creation:
final IsoMessage req = this.messageFactory.newMessage(NET_INFO_REQUEST.getValue()); req.setBinaryIsoHeader("6000050000".getBytes());
Regards
Solution:
final LongBcdCodec longBcdCodec = new LongBcdCodec(false); req.setBinaryIsoHeader(longBcdCodec.encodeBinaryField(6000050000l));
Log in to post a comment.
Hello,
A trying to sen a binary iso header like a documentation shown, the message show the next output:
My TPDU string is next: 6000050000, when i set de property setBinaryIsoHeader on my IsoMessage, the output show the TPDU like that:
[0x36303030303530303030]
this only printed by debugString method in IsoMessage Class
All Message:
[0x36303030303530303030]08002220010000C0001099000008261337000014841127202409203659307 0004OPv1
this message almost are correctly encoded... but there is a way to encode binary iso header in bytes without hexadecimal encodig?
This is because when i send the message to the server the TPDU is encoded in hex:
And the correct way will be something like this:
My factory configuration:
IsoMessage creation:
Regards
Last edit: Jesús Armando Verde 2022-08-26
Solution: