I have been able to get over the header issue. I set the header on the ISO server (header="A4M05000").
I also implemented the setHeader as /**
* * @param header Hex representation of header
*/
public void setHeader (String header) {
super.setHeader (
ISOUtil.hexString(header.getBytes(), 0, header.length()/2)
);
}
However, I am having some problems with the packager unpacking the message. Kindly assist to review with possible solution. My sample message can be found below.
Notice that the dump of the message appears different when it gets to the ISO server with additional 30 30 30 30 31 at the end of the message.
The error I get can be seen after the request message.
30383030383233303030303030303030303030303034303030303030303030303030303030313237313631313230303030303030313635313431333031
<log realm="channel.web-channel-adaptor/
127.0.0.1:6100" at="Sun Jan 27 16:11:20 WAT 2013.676">
<connect>
127.0.0.1:6100 </connect>
</log>
<log realm="channel.web-channel-adaptor/
127.0.0.1:6100" at="Sun Jan 27 16:11:20 WAT 2013.723">
<send>
<isomsg direction="outgoing">
<header>41344D3035303030</header>
<field id="0" value="0800"/>
<field id="7" value="0127161120"/>
<field id="11" value="000000"/>
<field id="12" value="165141"/>
<field id="70" value="301"/>
</isomsg>
</send>
</log>
Exception:
<log realm="postpack-debug" at="Sun Jan 27 16:11:20 WAT 2013.739">
<unpack>
3038303038323330303030303030303030303030303430303030303030303030303030303031
323731363131323030303030303031
<bitmap>{1, 7, 11, 12, 70}</bitmap>
<unpack fld="7" packager="org.jpos.iso.IFA_NUMERIC">
<value>0127161120</value>
</unpack>
<unpack fld="11" packager="org.jpos.iso.IFA_NUMERIC">
<value>000000</value>
</unpack>
<iso-exception>
org.jpos.iso.IFA_NUMERIC: Problem unpacking field 12
<nested-exception>
java.lang.ArrayIndexOutOfBoundsException: 53
at org.jpos.iso.AsciiInterpreter.uninterpret(AsciiInterpreter.java:88)
at org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.jav
a:204)
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:229)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:322)
at org.jpos.iso.BaseChannel.receive(BaseChannel.java:531)
at org.jpos.iso.ISOServer$Session.run(ISOServer.java:123)
at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:100)
</nested-exception>
org.jpos.iso.ISOException: org.jpos.iso.IFA_NUMERIC: Problem unpacking fie
ld 12 (java.lang.ArrayIndexOutOfBoundsException: 53)
at org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.jav
a:209)
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:229)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:322)
at org.jpos.iso.BaseChannel.receive(BaseChannel.java:531)
at org.jpos.iso.ISOServer$Session.run(ISOServer.java:123)
at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:100)
Nested:java.lang.ArrayIndexOutOfBoundsException: 53
at org.jpos.iso.AsciiInterpreter.uninterpret(AsciiInterpreter.java:88)
at org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.jav
a:204)
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:229)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:322)
at org.jpos.iso.BaseChannel.receive(BaseChannel.java:531)
at org.jpos.iso.ISOServer$Session.run(ISOServer.java:123)
at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:100)
</iso-exception>
--- header ---
0000 41 34 4D 30 35 30 30 30 A4M05000
--- data ---
0000 30 38 30 30 38 32 33 30 30 30 30 30 30 30 30 30 0800823000000000
0010 30 30 30 30 30 34 30 30 30 30 30 30 30 30 30 30 0000040000000000
0020 30 30 30 30 30 31 32 37 31 36 31 31 32 30 30 30 0000012716112000
0030 30 30 30 30 31 00001