После упаковки моих данных и при попытке отправить на канал JPOS (сервер) я получаю следующую ошибку.
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: проблема с распаковкой поля 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 30 02 38 00 00 00 С2 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 060002171900
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. Все предложения приветствуются.