0

Good morning, I am new to jpos, the problem I have is I am sending a message with a header, but when sending it, it always adds a character at the end 03 in hexadecimal.

code of how I send it

code of how I send it

   // Create Packager based on XML that contain DE type
   GenericPackager packager = new GenericPackager("PackISO.xml");

   // Crea una instancia de la clase BASE24TCPChannel
   BASE24TCPChannel c = new BASE24TCPChannel("localhost", 5000,packager);
   c.setHeader("ISO008000099");
       
   // Create ISO Message
   ISOMsg isoMsg = new ISOMsg();        
   isoMsg.setPackager(packager);
 
   isoMsg.setMTI("0800");
   isoMsg.set(7, "1088110140");
   isoMsg.set(11, "087478");
   isoMsg.set(70, "999");

   c.connect();
   c.send(isoMsg);

This is what send sends, I capture this using netcat nc -l -p 5000 | xxd

00000000: 0044 4953 4f30 3038 3030 3030 3939 3038  .DISO00800009908
00000010: 3030 3832 3230 3030 3030 3030 3030 3030  0082200000000000
00000020: 3030 3034 3030 3030 3030 3030 3030 3030  0004000000000000
00000030: 3030 3130 3838 3131 3031 3430 3038 3734  0010881101400874
00000040: 3738 3939 3903                           78999.

"03" always arrives at the end of each message, how do I disable it so that it is not sent? 00000040: 3738 3939 39**03** 78999**.**

Raul Roa
  • 21
  • 4

1 Answers1

0

If you don't want that trailer, you need to use another channel.

PostChannel or NACChannel do essentially the same, but doesn't send the trailer.

   ...
   PostChannel c = new PostChannel("localhost", 5000,packager);
   c.setHeader("ISO008000099".getBytes(ISOUtil.ENCODING));
   ...

You have to set the header as bytes also, because the string setHeader overload expects a hex representation.

Andrés Alcarraz
  • 1,570
  • 1
  • 12
  • 21