Вроде разобрался теперь ответ не распаковывается ответ
public class ClientSocket {
//Должно получиться 30 38 30 30 82 20 00 00 00 00 00 00 04 00 00 00 00 00 00 00 11 13 12 53 20 12 34 56 03 01
//Сейчас 30 38 30 30 82 20 08 00 22 20 00 00 00 00 00 00 00 00 00 00 11 13 12 53 20 12 34 56 03 01
public static void main(String[] args) throws ISOException, ISOClientException, IOException, org.jpos.iso.ISOException {
ISOMessage isoMessage = ISOMessageBuilder.Packer(VERSION.V1987)
.defaultMan()
.mti(MESSAGE_FUNCTION.Request, MESSAGE_ORIGIN.Acquirer)
.processCode("0000000")
.setField(FIELDS.F7_TransmissionDataTime, "1113125320")
.setField(FIELDS.F11_STAN, "1234560301")
.setHeader("303830308220")
.build();
ISOClient client = ISOClientBuilder.createSocket("172.20.104.69", 5803)
.build();
System.out.println("isoMessage " + isoMessage);
client.connect();
byte[] response = client.sendMessageSync(isoMessage);
System.out.println("responseByte " + response);
System.out.println("response = " + Arrays.toString(response));
String hexString = StringUtil.fromByteArray(response);
System.out.println("response(hexString) = " + hexString);
client.disconnect();
// ParseISOMsg.parseISOMsg(hexString);
ISOMessage isoMessageUnpack = ISOMessageBuilder.Unpacker()
.setMessage(hexString)
.build();
byte[] body = isoMessage.getBody();
System.out.println("isoMessageUnpack " + isoMessageUnpack.getField(7));
}
}
response = [48, 56, 49, 48, -126, 32, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 17, 19, 18, 83, 32, 18, 52, 86, 48, 48, 3, 1]
response(hexString) = 3038313082200000020000000400000000000000111312532012345630300301
Exception in thread "main" com.imohsenb.ISO8583.exceptions.ISOException: Field No 7 does not exists
at com.imohsenb.ISO8583.entities.ISOMessage.getField(ISOMessage.java:84)
at ClientSocket.main(ClientSocket.java:49)
Может специальная кодировка. Может подскажете направление как это перевести примерно вот в такое:
Догадываюсь что там это, так как вижу ответ этот в логах :
Message type 0810
P0007 Transmission date and time LEN=10 OFFS=20 '0000000000'
P0011 Systems Trace Audit Number LEN=6 OFFS=30 '000000'
P0039 Response code LEN=2 OFFS=36 '00'
P0006 Network Management Code LEN=3 OFFS=38 '000'