I am new to JPOS, I need to connect to a TCP/IP connection to send different iso messages like 0800, 0200, but to connect to the server it tells me that the TCP/IP connection type must be Dedicated and Full-Duplex (asynchronous) and will establish a single TCP session.
to explain better, I have developed some java classes for iso messages, which send the message and receive the response. But since I have developed it to send the message, I always have to connect to the socket and after I receive the response, I disconnect. That class I have in java is called from a REST api that has the message data. From my java class I would instantiate it by jpos-2.1.8.jar. But the company where I connect tells me that a transactional connection scheme is not allowed where for each Transaction it connects, sends a request, receives a response and disconnects. It tells me that it must be a TCP/IP connection type, it must be Dedicated and Full-Duplex (asynchronous) and it will establish a single TCP Session.
This is one of the java classes that I have developed
public Map<String, Object> msj0200(String parm1,String parm2, String parm3, String parm4,String parm5, String parm6,String parm7,String parm8) throws ISOException, Throwable {
Create Packager based on XML that contain DE type
GenericPackager packager = new GenericPackager("PackISO.xml");
NACChannel c = new NACChannel();
c.setHost("161.107.88.248");
c.setPort(5000);
c.setTimeout(10000);
c.setPackager(packager);
// Create ISO Message
ISOMsg isoMsg = new ISOMsg();
isoMsg.setHeader("ISO099002002".getBytes());
isoMsg.setMTI("0200");
isoMsg.set(7, parm1);
isoMsg.set(11, parm2);
isoMsg.set(48, parm3);
isoMsg.set(70, parm4);
isoMsg.set(22, parm5);
isoMsg.set(33, parm6);
isoMsg.set(45, parm7);
isoMsg.set(49, parm8);
isoMsg.setPackager(packager);
///I connected
c.connect();
///I send the message
c.send(isoMsg);
///I get the answer del socket
ISOMsg response = c.receive();
//Here I have the logic to return the response to the rest api
///and then i disconnect
c.disconnect();
To make the explanation more graphic, I now have the development
What I understand you must create the jPOS Gateway to be able to send the messages with a permanent session and full duplex.
and excuse me how I tell you I'm new to this tpc/ip and Jpos. I hope you can understand my problem. thanks in advance