Alejandro Revilla | 29 Apr 20:18

Re: How to get bitmap field values

>
> I need to check if the ISOMessage contains my pre-defined ISO fields and
> if there are any extra fields present.
>
I understand. You can't do that out-of-the-box, but you can get a hold
of the BitSet (using m.getValue(-1)) and then using ISOUtil.bitSet2byte
in order to get a byte[]. 

Then you can either compare at the byte[] array level or use
ISOUtil.hexString and deal with Strings.

In some of my systems I use a 'CheckField' transaction participant that
you can configure like this:

  <participant class="org.jpos.jcard.CheckFields" logger="Q2" realm="CheckRequiredFields">
   <property name="mandatory" value="PCODE,7,11,12,13,AMOUNT,PAN,41" />
   <property name="optional"  value="17,32,37,42,43,46,60,63,111" />
  </participant>

you can use the code as a reference: http://jpos.org/private/CheckFields.java

--Alejandro

------------------------------------


Gmane