Skip to content

DiKode

Coding Journal

Menu
  • Home
  • Author
  • Contact Me
  • Category
    • Java
    • Javascript
  • Privacy Policy
Menu

Create jPOS Custom XML Channel not ISO8583 Format

Posted on June 25, 2015October 26, 2017 by didikhari

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:

[java]
/**
* 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 {
msg.setMTI(“0200”);
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) {
e.printStackTrace();
}
return msg;
}
[/java]
Thats all my post about

Create jPOS Custom XML Channel not ISO8583 Format

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

  1. PHENOM says:
    June 26, 2015 at 2:20 am

    why dont use xmlchannel? it`s different?

    Reply
    1. Didik H says:
      June 28, 2015 at 10:40 pm

      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):

      
          
              
                  355972867329
                  170215001113
                  60
              
              
                  0011531174
                  99
              
          
      

      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.

      Reply
  2. Rj says:
    June 29, 2015 at 1:26 pm

    Great idea !!!
    😀

    Reply
    1. Didik H says:
      June 30, 2015 at 4:01 am

      Thanks Bro 😀

      Reply
  3. phenom says:
    June 30, 2015 at 2:45 am

    ah..thank you very much for your explanation and sample message..

    Reply
    1. Didik H says:
      June 30, 2015 at 4:01 am

      You’re welcome, thanks for visiting my blog. 🙂

      Reply
  4. nomatterwhoiam says:
    July 26, 2015 at 9:37 am

    ngeri ganz

    Reply
  5. Francisco says:
    June 17, 2016 at 9:17 pm

    Hello
    You’ve done something with SOAP messages

    Reply
    1. Didik H says:
      June 20, 2016 at 3:21 am

      Hi, do you mean creating SOAP listener on top of jPOS?

      Reply
    2. Francisco says:
      June 29, 2016 at 10:01 pm

      So is
      Right now I work on something to get http-soap in JPOS.
      Although nothing is concluded here is the repo https://github.com/refrazul/jPOS-test

      Reply
  6. Moses says:
    December 5, 2016 at 7:03 am

    Link is broken please

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Java
  • Javascript
  • jPOS

Recent Post

  • jPOS Server in-out
  • How to Configure Basic Auth Spring RestTemplate
  • Create Custom jPOS ISO8583 Packager
  • Binding Restful XML Parameter
  • Create Dynamic Tree Grid using TreeGrid jQuery Plugin

Tags

Asynchronous Request async request Bind Json Param custom channel custom jPOS packager datatables Design Pattern hibernate http http basic auth http request iso 8583 java javascript jPOS jpos channel jPOS Client jPOS database jPOS deploy directory jPOS Hibernate jpos http jpos rest jPOS Server jpos Space jquery js jsf load balancer moxy mux mux pool prettyfaces primefaces rest client Restful SAF space Specifications spring framework TCP Template Method transaction manager transaction participant tree TreeGrid

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2021 DiKode | Built using WordPress and Responsive Blogily theme by Superb