Create jPOS Custom XML Channel not ISO8583 Format

Today, i have new project for creating TCP server and client for electronic financial transaction.
Actually, i feel strange to the requirment because we have to sent xml messaging through an TCP, my big question is WHY DONT YOU USE HTTP??? and my boss said, “we have to coddling the clients!” so i can’t say anything.

I am jPOS ISO8583 framework fanatics, so i want to use jPOS for this project. My big problems is, the messaging is not ISO8583 format, so i have to custom to fits the jPOS framework work flow. Then, i look the sample request, response message and getting a big idea *i think*. I want to Create jPOS Custom XML Channel ISO8583 Format and put the xml message into jPOS ISOMsg class.

So, the only solution is write my own Custom Channel and i have to use XMLPackager because these packager is not specify the bit length or bit type (IFCHAR, IFA_LLLCHAR, etc). The messaging specification is [len][xml_data], so in my mind i have to overide the sendMessageLength(len) and getMessageLength() methods because i need to read message based on length.

The second thing is i have put the xml message into ISOMsg format. In this case, i will overade the send() and receive() methods. The xml message key is on attribute SvcRqId and i need to read the value, and put into bit 11 (STAN) and bit 41 (Terminal Data), so i use SAX library to achieve that.

I just manipulate the byte message data so, it can fits into jPOS framework work flow, here the methods for creating ISOMsg from xml:

* Create ISOMsg and set the key (bit 11 / 41) based on SvcRqId tag
* @param xmlMsg
* @return ISOMsg
public static ISOMsg createMsg(String xmlMsg){
ISOMsg msg = new ISOMsg();
try {
String svcRqId = JposUtil.getXMLAttrValue(xmlMsg, Constant.SVCRQID_TAG);
msg.set(11, JposUtil.subString(svcRqId, 6, true));
msg.set(41, JposUtil.subString(svcRqId, 16, false));
msg.set(126, xmlMsg);
} catch (ISOException e) {
return msg;
Thats all my post about

Create jPOS Custom XML Channel not ISO8583 Format


Hi! iā€™m Didik Hari, I am Backend Developer, System Integration and Web Developer mostly using Java. I use jPOS for ISO 8583 integration format, and Spring to create Rest API.

11 thoughts to “Create jPOS Custom XML Channel not ISO8583 Format”

    1. Yes, its different. you can see the XMLChannel message specs, xml channel doesn’t read the message length, and the tag is must be like this


      My message specs is [len][xml body], and the tag is something like this (the front end system existing messaging):


      so, i have to create custom xml channel that put the message into ISOMsg object for jPOS core processing. (extends the XMLChannel and must use XMLPackager)

      Thank you for your question phenom.

Leave a Reply

Your email address will not be published.