【发布时间】:2016-07-26 11:34:48
【问题描述】:
打包我的数据并尝试发送到 JPOS 通道(服务器)后,我确实收到以下错误。
长度 = 0030 字节长度(b): 48 :: 传入数据 HEX(d): 3830300238000000C2820000303030303130303732323137313934363030303030363030303231383030303631373139 org.jpos.iso.IFA_LLNUM:解包字段 33 的问题(java.lang.ArrayIndexOutOfBoundsException:48)解包字段 = 33, 消耗=42 org.jpos.iso.ISOException: org.jpos.iso.IFA_LLNUM: 问题解包字段 33 (java.lang.ArrayIndexOutOfBoundsException: 48) 拆包字段=33,消耗=42 在 org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:273) 在 org.jpos.iso.ISOMsg.unpack(ISOMsg.java:416) 在 org.jpos.iso.BaseChannel.unpack(BaseChannel.java:903) 在 org.jpos.iso.BaseChannel.receive(BaseChannel.java:671) 在 org.jpos.iso.ISOServer$Session.run(ISOServer.java:130) 在 org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:71) - - 数据 - - 0000 38 30 02 38 00 00 00 00 00 00 C2 82 00 00 30 30 30 30 800.8 ....... 0000 0010 31 30 30 32 32 32 30 30 30 30 30 30 30 30 30 30 30 32 31 38 30 30 30 36 31 37 31 39 0600021800061719
org.jpos.iso.IFA_LLNUM:解包字段 33 的问题(java.lang.ArrayIndexOutOfBoundsException:48)解包字段 = 33, 消耗=42 org.jpos.iso.ISOException: org.jpos.iso.IFA_LLNUM: 问题解包字段 33 (java.lang.ArrayIndexOutOfBoundsException: 48) 拆包字段=33,消耗=42 在 org.jpos.iso.ISOBasePackager.unpack(ISOBasePackager.java:273) 在 org.jpos.iso.ISOMsg.unpack(ISOMsg.java:416) 在 org.jpos.iso.BaseChannel.unpack(BaseChannel.java:903) 在 org.jpos.iso.BaseChannel.receive(BaseChannel.java:671) 在 org.jpos.iso.ISOServer$Session.run(ISOServer.java:130) 在 org.jpos.util.ThreadPool$PooledThread.run(ThreadPool.java:71)
而且,我正在使用下面的 java 类来传输我的打包数据。
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;
}
我目前面临的挑战是如何让我的 JPOS 渠道顺利进行。 非常欢迎所有建议。
【问题讨论】:
-
您的问题与 iso8583 消息打包无关。当处理意外/不受支持的数据打包/解析时,这纯粹是可能与外部库相关的开发问题。由于您的错误日志,当 TLV 数据使用一些意外的垃圾数据时,可能是 EMV 数据打包问题。
-
非常感谢您的回复。但是,我还没有真正理解的是。我看到了我的 Android Studio 控制台中包含的内容。但是,在另一个接收端,它只连接...而不显示已经打包的内容...在实际返回 null 错误之前。
-
正如@iso8583.infosupport所说,这应该是一个编程错误。但是您是否仔细检查过是否在 ISO 数据元素 55 中遇到异常,或者是否来自其他数据元素?是否可以在处理元素时一一记录元素,以准确查看它在哪个阶段失败。
-
我注意到的是,我的打包程序打包了所有必填字段,但是在获取不需要打包的字段时...它返回 null...。这是否意味着我必须发送我的 isoPackager 中所需的所有内容。因为,我的 isoField 有一个结构化设计,格式如下 /* 01 SALE */ { F02_PAN, F03_PROC, F04_AMOUNT, F11_STAN, F14_EXP, F22_POSE, F23, F25_POCC, F26_CAPTURE, F35_TRACK2, F36_TRACK3, F38_AUTH, F39_RSP, F41_TID, F42_ACCID, F49_CURRENCY, F52_PIN, F53_SCI, F55_ICC, F60, F64_MAC },
-
仅供参考,在 ISO8583 接口中,您可以定义位图(指定什么是强制性的、可选的、非必需的)和逐个字段的规范。所有必填字段都将被填充,否则消息会因格式错误而从感知端被拒绝。只要不是强制性的,该位就应该是可选的。
标签: java android iso emv iso8583