Having issues with my ISO8583 packager while connecting to jpos channel

故事扮演 提交于 2019-12-10 12:26:36

问题


After packing my data and while trying to send to JPOS channel (server), i do receive the below error.

Length = 0030 Byte length(b): 48 :: Incoming data HEX(d): 3830300238000000C2820000303030303130303732323137313934363030303030363030303231383030303631373139 org.jpos.iso.IFA_LLNUM: Problem unpacking field 33 (java.lang.ArrayIndexOutOfBoundsException: 48) unpacking field=33, consumed=42 org.jpos.iso.ISOException: org.jpos.iso.IFA_LLNUM: Problem unpacking field 33 (java.lang.ArrayIndexOutOfBoundsException: 48) unpacking field=33, consumed=42 at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:273) at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:416) at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:903) at org.jpos.iso.BaseChannel.receive(BaseChannel.java:671) at org.jpos.iso.ISOServer$Session.run(ISOServer.java:130) at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:71) --- data --- 0000 38 30 30 02 38 00 00 00 C2 82 00 00 30 30 30 30 800.8.......0000 0010 31 30 30 37 32 32 31 37 31 39 34 36 30 30 30 30 1007221719460000 0020 30 36 30 30 30 32 31 38 30 30 30 36 31 37 31 39 0600021800061719

org.jpos.iso.IFA_LLNUM: Problem unpacking field 33 (java.lang.ArrayIndexOutOfBoundsException: 48) unpacking field=33, consumed=42 org.jpos.iso.ISOException: org.jpos.iso.IFA_LLNUM: Problem unpacking field 33 (java.lang.ArrayIndexOutOfBoundsException: 48) unpacking field=33, consumed=42 at org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:273) at org.jpos.iso.ISOMsg.unpack(ISOMsg.java:416) at org.jpos.iso.BaseChannel.unpack(BaseChannel.java:903) at org.jpos.iso.BaseChannel.receive(BaseChannel.java:671) at org.jpos.iso.ISOServer$Session.run(ISOServer.java:130) at org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:71)

And, i am using the below java class to transport my packed data.

public static String networkTransport(String isoMessage) throws UnknownHostException, IOException {
        Socket connection = new Socket("192.168.3.118", 1010);
        BufferedOutputStream bos = new BufferedOutputStream(connection.getOutputStream());

        OutputStreamWriter osw = new OutputStreamWriter(bos);
        int len = isoMessage.length(); // get the length of the data
        // SInce your packager name says Postilion, I think this will work.
        osw.write(len >> 8); // send the length bytes in 2 bytes. this is the byte 1
       // osw.write(len);// send the length bytes in 2 bytes. this is the byte 2

        osw.write(isoMessage);
        osw.flush();

        byte[] arrOutut = new byte[4096];
        int count = connection.getInputStream().read(arrOutut, 0, 4096);

        String clientRequest = "";
        for (int outputCount = 0; outputCount < count; outputCount++) {
            char response = (char) arrOutut[outputCount];
            clientRequest = clientRequest + response;
        }

        connection.close();

        return clientRequest;
    }

The challenge i am currently facing is how I can have a smooth flow with my JPOS channel. All suggestions are highly welcomed.


回答1:


Belew is how I would split your data.

383030                          //echo message type as you said 0800. 
                                But where is the starting 0 (0x30) ? 
0238000000C28200                //bitmap 8 bytes -  packed BCD
00303030303130303732323137313934363030303030363030303231383030303631373139 - data

Below are the bits you have turned on. Can you verify whether you have all the field data for the below turned on bits ? I don't understand why you need DE55 in an echo message.

0   0000
2   0010 7
3   0011 11, 12
8   1000 13
0   0000
0   0000
0   0000
0   0000
0   0000
0   0000
C   1100 41, 42
2   0011 47, 48
8   1000 49
2   0011 55, 56  
0   0000 
0   0000

On an assumption, I would split your data like below:

00 30 30 30 30 31 30 30 37 32   -   transmission date mmddhhmmss 
32 31 37 31 39                  -   trace number
34 36 30 30 30 30               -   local time
30 36 30 30                     -   local date
30 32 31 38 30 30 30 36         -   terminal id
31 37 31 39                     -   this is all the remaining data for bits 42, 47, 48, 49,
                                    55 and 56. 

So getting a null pointer is quite obvious.




回答2:


I was able to resolve this issue, while making use of the JPOS library, but had to strimline it to using just the things i will be needing at my own end.

If you may want to use this method on your android device, these are the folders i actually used

  1. Channel
  2. Filter
  3. Gui
  4. Header
  5. Packager
  6. Validator and the whole java class here

or better still, use all the files and folders here




回答3:


In packaging data for jpos server you have to check two details:

1) jpos server channel type (leading or trailing data)

2) jpos server packager

Please note that jpos server is not expecting raw stream data from clients. On jpos.org site you can find very good written jpos manual.



来源:https://stackoverflow.com/questions/38588803/having-issues-with-my-iso8583-packager-while-connecting-to-jpos-channel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!