Using a hex to ascii converter , your raw data
3442333534313730303030303030303031305e4a434220435245444954205445535420202020202020202020205e31383131323031313030303030303030303030303030373034303030303030
gets converted to
4B3541700000000010^JCB CREDIT TEST ^1811201100000000000000704000000
So it boils down to your length prepended to the data which is 4B which is decimal 75 which is correct (total 150 chars in hex raw data that you have provided).
You need to change the packager of the field to understand the length.
-chhil
--
--
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
Join us in IRC at http://webchat.freenode.net/?channels=jpos
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
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/547DA420.90104%40talktalk.net.
For more options, visit https://groups.google.com/d/optout.
On 02/12/2014 03:50, Nishandan G wrote:
> Track 1 data = [B]3541700000000010^JCB CREDIT TEST
> ^1811201100000000000000704000000
> as raw data from simulator =
> 3442333534313730303030303030303031305e4a434220435245444954205445535420202020202020202020205e31383131323031313030303030303030303030303030373034303030303030
You have provided the wrong raw data - it does not hold the track data
above?
>
> on packager i have configured Field 45 as, /*045*/ new IFA_LLCHAR(99,
> "TRACK 1 DATA")
Does this match your simulator field 45 definition? a two character
ASCII length?
>
> when parse the data i am getting only this portion '3569700000000010^JCB
> CREDIT TEST ^18112011000000' and rest getting truncate.
How long is the track you are expecting? What does it's length look
like in the message that goes over the network?
--
Mark
Hex 34 is ascii 4
Hex 42 is ascii B
The 4b together is the length Hex length and it's equivalent to decimal 75.
Your understanding is correct and mine is base on the Hex data you provided.
-chhil
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/874e84c6-82e9-46c4-8ae7-262d6aee12b5%40googlegroups.com.
To unsubscribe, send email to jpos-users+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
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+unsubscribe@googlegroups.com.
Before you get to this provide the following
1. Packager definition.
2. The raw Hex dump of the entire message. You can use isoutil Hex dump method in your channels receive method.
3. Logs with logger attached.
Need the above because :
Don't know details of Hex dump you have provided, does it include the length of the field on not.
Has the message been correctly unpacked till it's at unpacking your track 1.
You have mentioned the definition of the field is 1 byte length followed by variable data. The 4B is 2 bytes of length and it doesn't feel right.
-chhil
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/e8d19c08-0c26-4123-94b0-bec7da22a6d9%40googlegroups.com.
Logger logger = new Logger();
logger.addListener (new SimpleLogListener(System.out));
UserPackager p = new UserPackager(); //saved your packager in this p.setLogger(logger, “debug”);
ISOMsg msg = new ISOMsg();
msg.setPackager(p);
String raw = “F0F1F0F0763D4481A8E8A00810356970000000001000000000000000700000000000010012030130540020640930541203181112037216022000088870900008887090002503569700000000010D18112011000070400000F1F4F1F2F0F3F0F0F2F0F6F4F3F9F4F54040F3F3F3F2F5F6F2F2F0F3F5F4F8F7F14040D1C3C240E3C5E2E340D4C5D9C3C8C1D5E3404040404040E3C5E2E340C3C9E3E84040404040F3F4F43442333534313730303030303030303031305E4A434220435245444954205445532020202020202020202020205E31383131323031313030303030303030303030303030373034303030303030F9F7F8F8F4F006F2F2F2F5F2F8”;
try{
byte [] arr = ISOUtil.hex2byte(raw);
msg.unpack(arr);
} catch (Exception ex )
{
msg.dump(System.out, "");
ex.printStackTrace();
}
<log realm="debug" at="Wed Dec 03 15:31:23 IST 2014.45" lifespan="52ms">
<unpack>
F0F1F0F0763D4481A8E8A00810356970000000001000000000000000700000000000010012030130540020640930541203181112037216022000088870900008887090002503569700000000010D18112011000070400000F1F4F1F2F0F3F0F0F2F0F6F4F3F9F4F54040F3F3F3F2F5F6F2F2F0F3F5F4F8F7F14040D1C3C240E3C5E2E340D4C5D9C3C8C1D5E3404040404040E3C5E2E340C3C9E3E84040404040F3F4F43442333534313730303030303030303031305E4A434220435245444954205445532020202020202020202020205E31383131323031313030303030303030303030303030373034303030303030F9F7F8F8F4F006F2F2F2F5F2F8
<bitmap>{2, 3, 4, 6, 7, 11, 12, 13, 14, 16, 18, 22, 25, 32, 33, 35, 37, 41, 42, 43, 45, 49, 51, 61}</bitmap>
<unpack fld="2" packager="org.jpos.iso.IFB_LLHNUM">
<value>3569700000000010</value>
</unpack>
<unpack fld="3" packager="org.jpos.iso.IFB_NUMERIC">
<value>000000</value>
</unpack>
<unpack fld="4" packager="org.jpos.iso.IFB_NUMERIC">
<value>000000007000</value>
</unpack>
<unpack fld="6" packager="org.jpos.iso.IFB_NUMERIC">
<value>000000000100</value>
</unpack>
<unpack fld="7" packager="org.jpos.iso.IFB_NUMERIC">
<value>1203013054</value>
</unpack>
<unpack fld="11" packager="org.jpos.iso.IFB_NUMERIC">
<value>002064</value>
</unpack>
<unpack fld="12" packager="org.jpos.iso.IFB_NUMERIC">
<value>093054</value>
</unpack>
<unpack fld="13" packager="org.jpos.iso.IFB_NUMERIC">
<value>1203</value>
</unpack>
<unpack fld="14" packager="org.jpos.iso.IFB_NUMERIC">
<value>1811</value>
</unpack>
<unpack fld="16" packager="org.jpos.iso.IFB_NUMERIC">
<value>1203</value>
</unpack>
<unpack fld="18" packager="org.jpos.iso.IFB_NUMERIC">
<value>7216</value>
</unpack>
<unpack fld="22" packager="org.jpos.iso.IFB_NUMERIC">
<value>0220</value>
</unpack>
<unpack fld="25" packager="org.jpos.iso.IFB_NUMERIC">
<value>00</value>
</unpack>
<unpack fld="32" packager="org.jpos.iso.IFB_LLHNUM">
<value>88709000</value>
</unpack>
<unpack fld="33" packager="org.jpos.iso.IFB_LLHNUM">
<value>88709000</value>
</unpack>
<unpack fld="35" packager="org.jpos.iso.IFB_LLHNUM">
<value>3569700000000010=18112011000070400000</value>
</unpack>
<unpack fld="37" packager="org.jpos.iso.IFE_CHAR">
<value>141203002064</value>
</unpack>
<unpack fld="41" packager="org.jpos.iso.IFE_CHAR">
<value>3945 33</value>
</unpack>
<unpack fld="42" packager="org.jpos.iso.IFE_CHAR">
<value>3256220354871 </value>
</unpack>
<unpack fld="43" packager="org.jpos.iso.IFE_CHAR">
<value>JCB TEST MERCHANT TEST CITY 344</value>
</unpack>
<unpack fld="45" packager="org.jpos.iso.IFA_LLCHAR">
<value>3541700000000010^JCB CREDIT TES ^18112011000000</value>
</unpack>
<unpack fld="49" packager="org.jpos.iso.IFE_CHAR">
<value>???</value>
</unpack>
<unpack fld="51" packager="org.jpos.iso.IFE_CHAR">
<value>???</value>
</unpack>
error unpacking field 61 consumed=229
<iso-exception>
org.jpos.iso.IFB_LLHECHAR: Problem unpacking field 61
<nested-exception>
java.lang.ArrayIndexOutOfBoundsException: 253
at org.jpos.iso.ISOUtil.ebcdicToAsciiBytes(ISOUtil.java:218)
at org.jpos.iso.ISOUtil.ebcdicToAscii(ISOUtil.java:205)
at org.jpos.iso.EbcdicInterpreter.uninterpret(EbcdicInterpreter.java:50)
at org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.java:180)
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:255)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:460)
at Test.main(Test.java:29)
</nested-exception>
org.jpos.iso.ISOException: org.jpos.iso.IFB_LLHECHAR: Problem unpacking field 61 (java.lang.ArrayIndexOutOfBoundsException: 253)
at org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.java:185)
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:255)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:460)
at Test.main(Test.java:29)
Nested:java.lang.ArrayIndexOutOfBoundsException: 253
at org.jpos.iso.ISOUtil.ebcdicToAsciiBytes(ISOUtil.java:218)
at org.jpos.iso.ISOUtil.ebcdicToAscii(ISOUtil.java:205)
at org.jpos.iso.EbcdicInterpreter.uninterpret(EbcdicInterpreter.java:50)
at org.jpos.iso.ISOStringFieldPackager.unpack(ISOStringFieldPackager.java:180)
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:255)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:460)
at Test.main(Test.java:29)
</iso-exception>
<iso-exception>
org.jpos.iso.IFB_LLHECHAR: Problem unpacking field 61 (java.lang.ArrayIndexOutOfBoundsException: 253) unpacking field=61, consumed=229
org.jpos.iso.ISOException: org.jpos.iso.IFB_LLHECHAR: Problem unpacking field 61 (java.lang.ArrayIndexOutOfBoundsException: 253) unpacking field=61, consumed=229
at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:284)
at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:460)
at Test.main(Test.java:29)
</iso-exception>
</unpack>
</log>
Lets concentrate on
JCB TEST MERCHANT TEST CITY 344 3541700000000010^JCB CREDIT TES ^18112011000000
If find the 344 in the ebcidic hex data (since field 43 is EBCIDIC) its F3F4F4, following this is the track 1 length followed by track 1 data
Snipped from hex data from field 43s 344
F3F4F43442333534313730303030303030303031305E4A434220435245444954205445532020202020202020202020205E31383131323031313030303030303030303030303030373034303030303030F9F7F8F8F4F006F2F2F2F5F2F8
So basically what I had stated earlier, you will need to write a custom packager that understands and interpret the length 3442 as 4B and extract the next 75 bytes.
I dont think a packager for it exists, if there is one, hopefully someone will point you to it.
-chhil