I use JPOS to send and receive ISO 8583 messages. Here is Client :
public static void main(String[] args) throws IOException, ISOException {
System.setProperty("java.net.preferIPv4Stack", "true");
EvnMsg msg = new EvnMsg();
ISO93APackager packager = new ISO93APackager();
msg.setPackager(packager);
msg.setMTI("1804");
msg.setAuditNumber("124125");
ASCIIChannel channel = new ASCIIChannel("Server_IP", PORT, packager);
channel.connect();
channel.send(msg);
channel.receive();
//channel.disconnect();
}
Here is Server :
public static void main(String[] args) throws IOException, ISOException {
ISO93APackager packager = new ISO93APackager();
ServerChannel channel = new ASCIIChannel (packager);
channel.accept(new ServerSocket(PORT));
ISOMsg isoMsg = channel.receive();
System.out.println("Received");
}
Server is received message, but the problem is that the bitmap has value of -1
So did i made a mistake? Which is the right way to receive the message?
That's an internal representation used by jPOS, feel free to ignore that fact; the bitmap will be properly produced once the channel calls the ISOMsg's pack()
method.
A few comments:
EnvMsg
is not part of jPOS, I'm assuming you're extending ISOMsg
msg.setPackager
, the channel will take care of that on your behalfQServer
classChannelAdaptor
classQMUX