On 25/03/2014 23:31, Ramses Vidor wrote:
>
> What I tried so far:
> 1. Configured the GenericPackager with an xml file according to the
> specs from MasterCard IPM Format doc. It looks like this:
Ok
> 2. When I execute the following code:
>
> |
> ISOMsg message = new ISOMsg();
> message.setPackager(new GenericPackager("path/to/my/config.xml");
> message.unpack(myIPMFileBytes);
How do you form 'myIPMFileBytes' ?
Is it the first data record in the file?
Do these bytes have any structure?
Is there a header?, can you share a sample of the data?
>
> for (Entry<Integer, ISOComponent> transaction : ((Map<Integer,
> ISOComponent>) message.getChildren()).entrySet()) {
> System.out.println(MessageFormat.format("{0} : {1}",
> transaction.getKey(), transaction.getValue().getValue()));
> }
> |
message.dump might be easier to 'read'?
>
> 3. The output generated from this snippet is:
>
> |
> -1 : {1, 2, 3, 4, 5, 6, 7, 8, 12, 14, 15, 18, 22, 25, 26, 27, 28, 29,
> 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
> 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
> 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
> 84, 85, 86, 87, 88, 90, 91, 93, 96, 98, 99, 100, 106, 120, 126, 128}
> 0 : 0000
> 2 : 50
> 3 : 011310
> 4 : 230000001488
> 5 : 101101012200
> 6 : 1T00000001
> |
>
> It doesn't seem to be right, as the MTI is coming as 0000 and not all
> fields I need to extract data from are listed in the bit map (DE2, DE3,
> DE5, DE6, DE12, DE24, DE31, DE48/PDS147, PDS159, PDS0105 and PDS0195).
The bytes that have been taken as the bitmap are not correct...
>
> What am I doing wrong here?
The bytes you are giving to the unpack do not match the form defined by
your packager.
The contents of 'myIPMFileBytes' *have* to be just a single message
*and* their structure needs to match that defined by the Packager (or
vice versa).
--
Mark