Extract bitmap in the form of bits.

596 views
Skip to first unread message

darkapple

unread,
Jun 4, 2010, 2:13:36 AM6/4/10
to jPOS Users
Basically, I'm developing an ISO8583 parser with the help ho jPOS. The
user input the message string which I convert to ISOMsg. I'm able to
get all the data elements through ISOMsg object. However I'm still
unable to get the bitmap from the ISOMsg.

Should I iterate over all the fields and check ISOMsg.hasField(..) or
there is another method to get the bitmap?

I want to show the bitmap string as well as its binary equivalent.

Thanks

Mark Salter

unread,
Jun 4, 2010, 4:13:26 AM6/4/10
to jpos-...@googlegroups.com
On 04/06/2010 07:13, darkapple wrote:
> Basically, I'm developing an ISO8583 parser with the help ho jPOS. The
> user input the message string which I convert to ISOMsg.
A message 'string' including a bit map, or just field values?

> I'm able to
> get all the data elements through ISOMsg object. However I'm still
> unable to get the bitmap from the ISOMsg.
>
> Should I iterate over all the fields and check ISOMsg.hasField(..) or
> there is another method to get the bitmap?

The bitmap is kept in field -1 within an ISOMsg, so through
isomsg.getValue(-1), you should get an ISOBitMap object back.

>
> I want to show the bitmap string as well as its binary equivalent.

ISOBitMap.getValue() returns a BitSet, which in turn provides
bitset.nextSetBit(0) to iterate through the bits set.

All slightly awkward, the reason being that jPOS protects you from the
parsing aspect and only exposes methods that have proven useful.

I would be inclined to iterate through the fields - or add a new method
to do so....

...have you considered the isomsg.dump method which produces and
xml-like version of the message and in which has a section of code you
could uncomment (ISOMsg lines 463-467) to include the bitmap in the output.

Can I ask where your user will get the data to input into your utility?
I'm wondering why a human driven step is needed and if it might be avoided.

--
Mark

darkapple

unread,
Jun 4, 2010, 9:09:33 AM6/4/10
to jPOS Users
Thanks Mark,







> A message 'string' including a bit map, or just field values?
Its a whole message string.
eg;
0200F23A448128E09000000000000400000016604873013644802730100000000000000004050952581631041452580405040560119010206604873356XXXXXXXXXXXXXXXXXXXXXXXX0000000000009509163104XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX4BF1A1E3A47D7A3219000SSSS0130000150MB



> The bitmap is kept in field -1 within an ISOMsg, so through
>isomsg.getValue(-1), you should get an ISOBitMap object back.

I was confused for a while. Since i'm trying to get bitmap in field 1
(not -1)
Why its in -1?

> I would be inclined to iterate through the fields - or add a new method
> to do so....

thanks

> ...have you considered the isomsg.dump method which produces and
> xml-like version of the message and in which has a section of code you
> could uncomment (ISOMsg lines 463-467) to include the bitmap in the output.
Yes

> Can I ask where your user will get the data to input into your utility?
>  I'm wondering why a human driven step is needed and if it might be avoided.
in a textbox
> --
> Mark

However I'm able to achieve my requirements as follows
String Binary bitmap : ISOUtil.bitSet2String(bset).substring(1)
String Hex Bitmap : ISOUtil.hexString(ISOUtil.bitSet2byte(bset))
BitSet :
ISOUtil.byte2BitSet(ISOUtil.bitSet2byte(bset), 0, true).toString()

Once I'll check your suggestions.

Alejandro Revilla

unread,
Jun 4, 2010, 12:47:19 PM6/4/10
to jpos-...@googlegroups.com

I was confused for a while. Since i'm trying to get bitmap in field 1
(not -1)
Why its in -1?

I can't remember now, but I think this was required to support ANSI X9.2 where the bitmap is an unnumbered field that goes after the MTI but it's not field 1 (field 1 is the PAN). We just wanted to take it away from the regular fields.

Mark Salter

unread,
Jun 4, 2010, 2:02:50 PM6/4/10
to jpos-...@googlegroups.com
On 04/06/2010 14:09, darkapple wrote:
>> Can I ask where your user will get the data to input into your utility?
>> I'm wondering why a human driven step is needed and if it might be avoided.
> in a textbox
Not where will they put it, where will they *get* it from?

8)

--
Mark

darkapple

unread,
Jun 7, 2010, 12:15:15 AM6/7/10
to jPOS Users

> where the bitmap is an unnumbered field that goes after the MTI but it's not
> field 1 (field 1 is the PAN). We just wanted to take it away from the
> regular fields.

I got it. but according to (http://en.wikipedia.org/wiki/ISO_8583)
field 1 is BITMAP, and 2 is mentioned as PAN.

Also in different ISO8583 packager included with jPOS field 1 is
mentioned as bitmap. I confused there.

darkapple

unread,
Jun 7, 2010, 12:17:57 AM6/7/10
to jPOS Users
> Not where will they put it, where will they *get* it from?

Oh mark, the data(message), we'll receive from various banking
application. And I want to confirm whether the fields are getting
right data.

Thanks.

Mark Salter

unread,
Jun 7, 2010, 2:45:56 AM6/7/10
to jpos-...@googlegroups.com
I was asking as I was wondering if you could improve your logging,
rather than copy paste from raw to your utility.

--
Mark

darkapple

unread,
Jun 8, 2010, 12:50:23 AM6/8/10
to jPOS Users
THANKS
Reply all
Reply to author
Forward
0 new messages