I use the postpack.xml provided by jpos which works. I didn’t look at your packager. You should go through yours field by field and see what’s not correct.
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISOUtil;
import org.jpos.iso.packager.GenericPackager;
import org.jpos.util.Logger;
import org.jpos.util.SimpleLogListener;
public class Blah {
public static void main(String[] args) {
//Take the hexdump from the email
String hex = "30323030B23A04D588E0812000000000" + "12000022353130303030303030303030"
+ "30303939393930393136323134333236" + "31313732323930393338333330393037"
+ "30393136303030303030384330303030" + "30303030433030303030303030303635"
+ "36313438313036313233343536303030" + "30303030333236313933303035303030"
+ "315A696D73776974636820205472616E" + "4642432045636F6E6574204D6F62696C"
+ "65204D6F6F6C61486172617265202020" + "20202020203731363933323030343135"
+ "31303031303030303030333236313930" + "36353631343831313232363337373236"
+ "39393535353031353130303435303230" + "30313330313231303030353830600014"
+ "00000000003130303030303033323631" + "395A73775372632020202020204D6574"
+ "43617368536E6B202031313732323931" + "31373232392020202020202020202020"
+ "20323032313039313630303439393231" + "38506F7374696C696F6E3A4D65746144"
+ "6174613232303231344164646974696F" + "6E616C44617461313131323134416464"
+ "6974696F6E616C44617461333433343C" + "3F786D6C2076657273696F6E3D22312E"
+ "302220656E636F64696E673D22555446" + "2D3822207374616E64616C6F6E653D22"
+ "796573223F3E3C6669656C643132373E" + "202020203C457874656E646564547261"
+ "6E73616374696F6E547970653E393030" + "303C2F457874656E6465645472616E73"
+ "616374696F6E547970653E202020203C" + "53656E64657244657461696C733E2020"
+ "2020202020203C42616E6B3E46424342" + "616E6B3C2F42616E6B3E202020202020"
+ "20203C4E6174696F6E616C49643E3633" + "323135313230374232383C2F4E617469"
+ "6F6E616C49643E20202020202020203C" + "4D6F62696C654E756D6265723E323633"
+ "3737323936323130303C2F4D6F62696C" + "654E756D6265723E2020202020202020"
+ "3C5265666572656E63653E546573743C" + "2F5265666572656E63653E2020202020"
+ "2020203C456D61696C41646472657373" + "3E6C6F76656A6F796D6170686F736140"
+ "7961686F6F2E636F6D3C2F456D61696C" + "416464726573733E202020203C2F5365"
+ "6E64657244657461696C733E20202020" + "3C5472616E507572706F7365436F6465"
+ "3E4F54523C2F5472616E507572706F73" + "65436F64653E3C2F6669656C64313237" + "3E";
ISOMsg m = new ISOMsg();
try {
GenericPackager pkg = new GenericPackager("location of jpos postpack.xml");
Logger l = new Logger();
l.addListener(new SimpleLogListener());
pkg.setLogger(l, "");
m.setPackager(pkg);
//convert the hex to bytes and feed it to unpack
byte[] arr = ISOUtil.hex2byte(hex);
m.unpack(arr);
m.dump(System.out, "");
}
catch (Exception e) {
m.dump(System.out, "x");
e.printStackTrace();
}
}
}
output
<log realm="-fld-127" at="2021-09-17T08:57:50.026" lifespan="392ms">
<unpack>
60001400000000003130303030303033323631395A73775372632020202020204D657443617368536E6B202031313732323931313732323920202020202020202020202032303231303931363030343939323138506F7374696C696F6E3A4D657461446174613232303231344164646974696F6E616C446174613131313231344164646974696F6E616C44617461333433343C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D225554462D3822207374616E64616C6F6E653D22796573223F3E3C6669656C643132373E202020203C457874656E6465645472616E73616374696F6E547970653E393030303C2F457874656E6465645472616E73616374696F6E547970653E202020203C53656E64657244657461696C733E20202020202020203C42616E6B3E46424342616E6B3C2F42616E6B3E20202020202020203C4E6174696F6E616C49643E3633323135313230374232383C2F4E6174696F6E616C49643E20202020202020203C4D6F62696C654E756D6265723E3236333737323936323130303C2F4D6F62696C654E756D6265723E20202020202020203C5265666572656E63653E546573743C2F5265666572656E63653E20202020202020203C456D61696C416464726573733E6C6F76656A6F796D6170686F7361407961686F6F2E636F6D3C2F456D61696C416464726573733E202020203C2F53656E64657244657461696C733E202020203C5472616E507572706F7365436F64653E4F54523C2F5472616E507572706F7365436F64653E3C2F6669656C643132373E
</unpack>
</log>
<log realm="" at="2021-09-17T08:57:50.754" lifespan="1151ms">
<unpack>
30323030B23A04D588E081200000000012000022353130303030303030303030303039393939303931363231343332363131373232393039333833333039303730393136303030303030384330303030303030304330303030303030303036353631343831303631323334353630303030303030333236313933303035303030315A696D73776974636820205472616E4642432045636F6E6574204D6F62696C65204D6F6F6C61486172617265202020202020202037313639333230303431353130303130303030303033323631393036353631343831313232363337373236393935353530313531303034353032303031333031323130303035383060001400000000003130303030303033323631395A73775372632020202020204D657443617368536E6B202031313732323931313732323920202020202020202020202032303231303931363030343939323138506F7374696C696F6E3A4D657461446174613232303231344164646974696F6E616C446174613131313231344164646974696F6E616C44617461333433343C3F786D6C2076657273696F6E3D22312E302220656E636F64696E673D225554462D3822207374616E64616C6F6E653D22796573223F3E3C6669656C643132373E202020203C457874656E6465645472616E73616374696F6E547970653E393030303C2F457874656E6465645472616E73616374696F6E547970653E202020203C53656E64657244657461696C733E20202020202020203C42616E6B3E46424342616E6B3C2F42616E6B3E20202020202020203C4E6174696F6E616C49643E3633323135313230374232383C2F4E6174696F6E616C49643E20202020202020203C4D6F62696C654E756D6265723E3236333737323936323130303C2F4D6F62696C654E756D6265723E20202020202020203C5265666572656E63653E546573743C2F5265666572656E63653E20202020202020203C456D61696C416464726573733E6C6F76656A6F796D6170686F7361407961686F6F2E636F6D3C2F456D61696C416464726573733E202020203C2F53656E64657244657461696C733E202020203C5472616E507572706F7365436F64653E4F54523C2F5472616E507572706F7365436F64653E3C2F6669656C643132373E
<bitmap>{1, 3, 4, 7, 11, 12, 13, 15, 22, 25, 26, 28, 30, 32, 33, 37, 41, 42, 43, 49, 56, 59, 100, 103, 123, 127}</bitmap>
<unpack fld="3" packager="org.jpos.iso.IFA_NUMERIC">
<value>510000</value>
</unpack>
<unpack fld="4" packager="org.jpos.iso.IFA_NUMERIC">
<value>000000009999</value>
</unpack>
<unpack fld="7" packager="org.jpos.iso.IFA_NUMERIC">
<value>0916214326</value>
</unpack>
<unpack fld="11" packager="org.jpos.iso.IFA_NUMERIC">
<value>117229</value>
</unpack>
<unpack fld="12" packager="org.jpos.iso.IFA_NUMERIC">
<value>093833</value>
</unpack>
<unpack fld="13" packager="org.jpos.iso.IFA_NUMERIC">
<value>0907</value>
</unpack>
<unpack fld="15" packager="org.jpos.iso.IFA_NUMERIC">
<value>0916</value>
</unpack>
<unpack fld="22" packager="org.jpos.iso.IFA_NUMERIC">
<value>000</value>
</unpack>
<unpack fld="25" packager="org.jpos.iso.IFA_NUMERIC">
<value>00</value>
</unpack>
<unpack fld="26" packager="org.jpos.iso.IFA_NUMERIC">
<value>08</value>
</unpack>
<unpack fld="28" packager="org.jpos.iso.IFA_AMOUNT">
<value>C00000000</value>
</unpack>
<unpack fld="30" packager="org.jpos.iso.IFA_AMOUNT">
<value>C00000000</value>
</unpack>
<unpack fld="32" packager="org.jpos.iso.IFA_LLNUM">
<value>561481</value>
</unpack>
<unpack fld="33" packager="org.jpos.iso.IFA_LLNUM">
<value>123456</value>
</unpack>
<unpack fld="37" packager="org.jpos.iso.IF_CHAR">
<value>000000032619</value>
</unpack>
<unpack fld="41" packager="org.jpos.iso.IF_CHAR">
<value>30050001</value>
</unpack>
<unpack fld="42" packager="org.jpos.iso.IF_CHAR">
<value>Zimswitch Tran</value>
</unpack>
<unpack fld="43" packager="org.jpos.iso.IF_CHAR">
<value>FBC Econet Mobile MoolaHarare 716</value>
</unpack>
<unpack fld="49" packager="org.jpos.iso.IF_CHAR">
<value>932</value>
</unpack>
<unpack fld="56" packager="org.jpos.iso.IFA_LLLCHAR">
<value>1510</value>
</unpack>
<unpack fld="59" packager="org.jpos.iso.IFA_LLLCHAR">
<value>0000032619</value>
</unpack>
<unpack fld="100" packager="org.jpos.iso.IFA_LLNUM">
<value>561481</value>
</unpack>
<unpack fld="103" packager="org.jpos.iso.IFA_LLCHAR">
<value>263772699555</value>
</unpack>
<unpack fld="123" packager="org.jpos.iso.IFA_LLLCHAR">
<value>100450200130121</value>
</unpack>
<unpack fld="127" packager="org.jpos.iso.ISOMsgFieldPackager">
<isomsg direction="none" id="127">
<!-- org.jpos.iso.packager.GenericSubFieldPackager -->
<field id="2" value="0000032619"/>
<field id="3" value="ZswSrc MetCashSnk 117229117229 "/>
<field id="20" value="20210916"/>
<field id="22"><![CDATA[218Postilion:MetaData220214AdditionalData111214AdditionalData3434<?xml version="1.0" encoding="UTF-8" standalone="yes"?><field127> <ExtendedTransactionType>9000</ExtendedTransactionType> <SenderDetails> <Bank>FBCBank</Bank> <NationalId>632151207B28</NationalId> <MobileNumber>263772962100</MobileNumber> <Reference>Test</Reference> <EmailAddress>lovejoy...@yahoo.com</EmailAddress> </SenderDetails> <TranPurposeCode>OTR</TranPurposeCode></field127>]]></field>
</isomsg>
</unpack>
</unpack>
</log>
<isomsg direction="none">
<!-- org.jpos.iso.packager.GenericPackager[/Volumes/Z Drive/SourceRepo/OIIDev/Incomm/build/cfg/postpack.xml] -->
<field id="0" value="0200"/>
<field id="bitmap" value="{1, 3, 4, 7, 11, 12, 13, 15, 22, 25, 26, 28, 30, 32, 33, 37, 41, 42, 43, 49, 56, 59, 100, 103, 123, 127}" type="bitmap"/>
<field id="3" value="510000"/>
<field id="4" value="000000009999"/>
<field id="7" value="0916214326"/>
<field id="11" value="117229"/>
<field id="12" value="093833"/>
<field id="13" value="0907"/>
<field id="15" value="0916"/>
<field id="22" value="000"/>
<field id="25" value="00"/>
<field id="26" value="08"/>
<field id="28" value="C00000000"/>
<field id="30" value="C00000000"/>
<field id="32" value="561481"/>
<field id="33" value="123456"/>
<field id="37" value="000000032619"/>
<field id="41" value="30050001"/>
<field id="42" value="Zimswitch Tran"/>
<field id="43" value="FBC Econet Mobile MoolaHarare 716"/>
<field id="49" value="932"/>
<field id="56" value="1510"/>
<field id="59" value="0000032619"/>
<field id="100" value="561481"/>
<field id="103" value="263772699555"/>
<field id="123" value="100450200130121"/>
<isomsg id="127">
<!-- org.jpos.iso.packager.GenericSubFieldPackager -->
<field id="2" value="0000032619"/>
<field id="3" value="ZswSrc MetCashSnk 117229117229 "/>
<field id="20" value="20210916"/>
<field id="22"><![CDATA[218Postilion:MetaData220214AdditionalData111214AdditionalData3434<?xml version="1.0" encoding="UTF-8" standalone="yes"?><field127> <ExtendedTransactionType>9000</ExtendedTransactionType> <SenderDetails> <Bank>FBCBank</Bank> <NationalId>632151207B28</NationalId> <MobileNumber>263772962100</MobileNumber> <Reference>Test</Reference> <EmailAddress>lovejoy...@yahoo.com</EmailAddress> </SenderDetails> <TranPurposeCode>OTR</TranPurposeCode></field127>]]></field>
</isomsg>
</isomsg>
public void run() {
GenericPackager pkg = new GenericPackager("cfg/packager/postpack.xml");
Logger l = new Logger();
l.addListener(new SimpleLogListener());
pkg.setLogger(l, "");
isoMsg.setPackager(pkg);
switch (isoMsg.getMTI()) {
case "0200": {
isoMsg.setResponseMTI();
isoMsg.set(39, "00");
isoSource.send(isoMsg);
Venon Mapfunde(PMP,Msc Software Engineering,Bsc Computer Science & Mathematics) Tel:+263 775 091 262 Email:taka...@gmail.com Skype: venon.mapfunde
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/892c35c0-72eb-44da-8f71-30a335f749c3n%40googlegroups.com.
Venon Mapfunde(PMP,Msc Software Engineering,Bsc Computer Science & Mathematics) Tel:+263 775 091 262 Email:taka...@gmail.com Skype: venon.mapfunde
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/7e5df4e6-15d3-46de-a828-8e03e70ff2fen%40googlegroups.com.
Venon Mapfunde(PMP,Msc Software Engineering,Bsc Computer Science & Mathematics) Tel:+263 775 091 262 Email:taka...@gmail.com Skype: venon.mapfunde
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAAfjTs-8x%2BsSVCgKrBQDqE9sUE8LpKMQ9%3DYT%2BAtw_t3_S4G_oQ%40mail.gmail.com.
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to a topic in the Google Groups "jPOS Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jpos-users/yAPQC_q6-5I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jpos-users+...@googlegroups.com.
Venon Mapfunde(PMP,Msc Software Engineering,Bsc Computer Science & Mathematics) Tel:+263 775 091 262 Email:taka...@gmail.com Skype: venon.mapfunde
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/f76add7e-24d9-4019-a657-26d3a62b8341n%40googlegroups.com.
Make sure all the data for the fields parsed up to the exception are correct and as expected. If not fix packager for field(s) that have incorrect data.
This is the hexdump of your message.
0000 31 32 31 30 F2 3A 04 C1 0A E0 80 20 00 00 00 00 1210.:..... ....
0010 12 00 00 22 31 36 36 33 39 33 31 32 31 30 31 30 ..."166393121010
0020 36 33 39 37 32 38 32 37 30 30 30 30 30 30 30 30 6397282700000000
0030 30 30 30 30 30 32 30 30 30 39 32 33 31 30 31 35 0000020009231015
0040 31 34 31 39 39 30 32 30 30 30 30 30 30 30 31 34 1419902000000014
0050 31 30 34 33 31 31 30 34 32 31 31 31 30 34 30 30 1043110421110400
0060 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
0070 31 32 30 36 36 30 31 32 33 37 31 33 30 38 31 34 1206601237130814
0080 30 37 31 36 38 31 39 30 38 4D 45 54 42 39 30 30 071681908METB900
0090 33 36 33 39 33 31 32 30 30 30 30 30 39 30 30 33 3639312000009003
00a0 34 30 4D 45 54 42 41 4E 4B 20 4D 6F 62 69 6C 65 40METBANK Mobile
00b0 20 4E 65 74 4F 6E 65 20 20 48 61 72 61 72 65 20 NetOne Harare
00c0 20 20 20 20 20 20 5A 57 5A 57 39 33 32 30 31 32 ZWZW932012
00d0 4C 30 30 30 31 31 38 38 32 33 35 30 30 36 35 30 L000118823500650
00e0 34 39 38 37 31 33 30 30 30 30 30 32 30 30 30 30 4987130000020000
00f0 33 32 35 30 31 35 30 36 30 30 30 30 32 36 35 30 3250150600002650
0100 30 30 31 32 31 30 30 30 30 39 35 00 00 04 00 00 00121000095.....
0110 00 00 00 ...
Based on the output the data gets parse till DE26. From the hexdump it the line that ends with 1110400 [DE25 = 11, DE26=10].
The next bit of information is for DE32, which is defined in the packager as IFA_LLNUM and can have a max length of 11.
The LL in the hexdump is 40 which is wrong and its possible we reached this point of failure because some previous fields were not configured correctly in the packager.
Go field by field starting with bitmap packager to see if you have them configured based on the spec you have. Maybe the out of box packager will not work for you and you will have to define packager for fields yourself.
0050 31 30 34 33 31 31 30 34 32 31 31 31 30 34 30 30 1043110421110400
0060 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 0000000000000000
0070 31 32 30 36 36 30 31 32 33 37 31 33 30 38 31 34 1206601237130814
Next, we try your packager.
It throws an exception after
x <field id="123" value="060000265000121"/>
From the hexdump at that point, we see that LLLLL for DE127 is 00009 .
0100 30 30 31 32 31 30 30 30 30 39 35 00 00 04 00 00 00121000095.....
0110 00 00 00 ...
The Bitmap is 35000004
35 = 0011 0101 [bits 3,4,6,8 set]
00 = 0000 0000
00 = 0000 0000
04 = 0000 0100 [bit 30 set]
You have DE 127.3 configured as fixed 48 rand thee isn’t aren't 48 bytes of data in the message to get.Â
You will need to correct your 127 subfield packagers (bitmap and field) based on the specification you ae working with
-chhil