How set message header to iso8583 message, is there any .xml called base24.xml

1,742 views
Skip to first unread message

MrSamintha

unread,
Oct 9, 2015, 4:48:26 AM10/9/15
to jPOS Users
How set message header to iso8583 message, is there any .xml called base24.xml

chhil

unread,
Oct 9, 2015, 5:12:53 AM10/9/15
to jpos-...@googlegroups.com

You can find base24.xml provided by jpos at
https://github.com/jpos/jPOS/blob/master/jpos/src/dist/cfg/packager/base24.xml

If you want to set header change the packager xmls root element to add a header attribute.

I have added a 12 byte header.

<isopackager headerLength="12">
  <isofield
      id="0"
      length="4"
      name="MESSAGE TYPE INDICATOR"
      class="org.jpos.iso.IFA_NUMERIC"/>
  <isofield....

Code snippet to set header, pack it, see it in a dump, unpack it, use getHeader to see it.

import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISOUtil;
import org.jpos.iso.packager.GenericPackager;
import org.jpos.util.Logger;
import org.jpos.util.SimpleLogListener;

public class B24 {

    public static void main(String[] args) throws ISOException {

        Logger l = new Logger();
        l.addListener(new SimpleLogListener(System.out));
        GenericPackager pkg = new GenericPackager("path/to/your/Base24.xml");
        pkg.setLogger(l, "Test");
        ISOMsg m = new ISOMsg("0200");

        m.setPackager(pkg);
        m.setHeader("123456123456".getBytes());

        m.set(2, "999999999999");
        byte[] packed = m.pack();
        System.out.println(ISOUtil.hexdump(packed));

        m.unpack(packed);
        System.out.println(new String(m.getHeader()));
        m.dump(System.out, "");

    }

}

-chhil


On Fri, Oct 9, 2015 at 2:18 PM, MrSamintha <wgs...@gmail.com> wrote:
How set message header to iso8583 message, is there any .xml called base24.xml

--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
 
Join us in IRC at http://webchat.freenode.net/?channels=jpos
 
You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/6c283f48-adb2-4093-a030-51716d3865ab%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages