Open ouadi opened 6 years ago
Well, the j8583
library doesn't help much in this case. The MessageFactory
requires that the user should know beforehand whether the header is present or not and in case it is present, he should know its length and type (ascii or binary).
I have created an enhancement request for our friends in j8583
.
In case the enhancement is accepted, there will be:
T Messagefactory.parseMessage(byte[])
that will lookup header presence, length and type from the iso8583-config
file,Map<Integer, String> getIsoHeaders()
and Map<Integer, byte[]> getBinaryIsoHeaders()
that will give access to the configured headers.I will post updated on my request here once it is resolved.
@ouadi, thank you for investigation
j8583 repo has moved here: https://bitbucket.org/chochos/j8583 The most recent release is still 1.12.0, but there is some activity there
The
Iso8583Decoder
doesn't handle messages with header.The
parseMessage()
at line 29 inIso8583Decoder
final IsoMessage isoMessage = messageFactory.parseMessage(bytes, 0);Is called with second argument set to
0
.Shouldn't be called with second argument set to the length of the header?
Hi ouadi, did you find a solution for this?
Yes, indeed
It has been long time
I remember very vaguely the solution I have implemented
I will share with you what I recall, but it could be incomplete:
IsoMessage
and call it SidMessage
. Two constructors of SidMessage
that accept a header either in plain or binary formatMessageFactory<SidMessage>
and call it SidMessageFactory
createIsoMessage(String header)
and createIsoMessageWithBinaryHeader(byte[] binHeader)
have been overwritten to return SidMessage
instancesparseMessage(byte[] buf, int isoHeaderLength)
and parseMessage(byte[] buf, int isoHeaderLength, boolean binaryIsoHeader)
have been overwritten to take into consideration the length of the underlying header.Hope this will help
The
Iso8583Decoder
doesn't handle messages with header.The
parseMessage()
at line 29 inIso8583Decoder
final IsoMessage isoMessage = messageFactory.parseMessage(bytes, 0);Is called with second argument set to
0
.Shouldn't be called with second argument set to the length of the header?