Base24 ISO Header resulting in double header

758 views
Skip to first unread message

Pieter Botha

unread,
Nov 21, 2013, 9:40:36 AM11/21/13
to jpos-...@googlegroups.com
Good day everyone,

Someone sometime ago created the idea of elements before the bitmap called headers. This resulted in a frenzy of headers (Visa and BIC ISO to name 2). I see some posts in the group revolving around headers for messages, even Base24 (which just happens to be the protocol I am to use). In short, I am to add an ISO header ("ISO123456789") and prepend it to messages going out and I can also expect messages coming in (echo requests, keys etc) to contain this ISO header. 
For prototyping I thought GenericPackager and a base24.xml would be a good fit (add headerLength="12" to the top element). This seemed to work rather well for incoming messages (except when I reply to them!). I then created a new ISOMsg and gave it GenericPackager with the base24.xml file containing the headerLength="12" as an attr.
Now I'm seeing <double double>
Details: Channel=PostChannel, Packager=GenericPackager, config=base24.xml
The request/DE-70=161 below is sent from my LogonManager via a qmux to a QServer (queues).

Could anyone maybe shed some light as to how I might be able to debug this guy?

TCP Dump:

16:32:36.169314 IP bah.local.1200 > net-test.60167: Flags [P.], seq 17890:17971, ack 2905, win 114, options [nop,nop,TS val 2667086515 ecr 2730576968], length 81
        0x0000:  649e f3ed 8d40 0015 17e7 4710 0800 4500  d....@....G...E.
        0x0010:  0085 6551 4000 4006 4223 0a01 01b4 c425  ..eQ@.@.B#.....%
        0x0020:  c324 04b0 eb07 754a d190 2125 c9c7 8018  .$....uJ..!%....
        0x0030:  0072 9376 0000 0101 080a 9ef8 82b3 a2c1  .r.v............
        0x0040:  4c48 004f 4953 4f30 3036 3030 3030 3535  LH.OISO006000055
        0x0050:  4953 4f30 3036 3030 3030 3535 3038 3030  ISO0060000550800
        0x0060:  3832 3230 3030 3030 3030 3030 3030 3030  8220000000000000
        0x0070:  3034 3030 3030 3030 3030 3030 3030 3030  0400000000000000
        0x0080:  3131 3231 3136 3332 3336 3030 3031 3430  1121163236000140
        0x0090:  3136 31                                  161

My Code:
            packager = new GenericPackager("cfg/base24.xml");
            msg.setPackager(packager);
            msg.set(7, ISODate.getDateTime(new Date()));
            msg.set(11, ISOUtil.zeropad(Long.toString(traceNumber), 6));
            msg.set(70, "161");
            msg.setHeader(("ISO006000055").getBytes());

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

The QServer XML Config:
<server name="net-server" class="org.jpos.q2.iso.QServer" logger="NETATM">
    <property name="debug" value="true"/>
    <attr name="port" type="java.lang.Integer">1200</attr>
    <property name="space" value="tspace:default"/>
    <property name="queue" value="RACEV.TXN"/>
    <channel name="mychannel" class="org.jpos.iso.channel.PostChannel" packager="org.jpos.iso.packager.GenericPackager"
             logger="NETATM">
        <property name="packager-config" value="cfg/base24.xml"/>
        <property name="debug" value="true"/>
    </channel>
    <in>to-netatm</in>
    <out>from-netatm</out>
</server>

Victor Salaman

unread,
Nov 21, 2013, 9:52:40 AM11/21/13
to jpos-...@googlegroups.com

Hi:

This has been discussed before but here we go again :) The 'header' actually gets handled at the channel level. So make sure you have 'header' attribute in your <channel> definition. The system uses this to determine the header length on an incoming message and as a default outgoing header.

/V
November 21, 2013 at 9:40 AM
--
--
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/49dcce75-c02f-4814-9a70-a65832cb2a28%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Alejandro Revilla

unread,
Nov 21, 2013, 9:54:42 AM11/21/13
to jPOS Users
Exactly, you can use an appropriate channel and then call channel.setHeader("ISO123456789");



--
@apr



compose-unknown-contact.jpg

Pieter Botha

unread,
Dec 2, 2013, 4:25:02 AM12/2/13
to jpos-...@googlegroups.com
Thank you guys. I've tested the channel approach and it looks like it is working rather well.


Op donderdag 21 november 2013 16:40:36 UTC+2 schreef Pieter Botha:

chhil

unread,
Dec 2, 2013, 11:53:57 AM12/2/13
to jpos-users
So when is one supposed to use the header length attribute in the packager definition?


<isopackager headerLength="12">

-chhil


--
--
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.

Pieter Botha

unread,
Jan 3, 2014, 2:39:25 AM1/3/14
to jpos-...@googlegroups.com
Hi Chhil,

I've now successfully tested my BIC ISO Channel and reverted back from GenericPackager to BASE24Packager (BASE24Packager does not make provision for special headers in the @Override methods). Everything is working perfect, no double headers or lack of headers; thus the config I'm giving the Channel is working. I have no idea why one would use the Packager for the header though looking at the Base1Header code it does correspond very nicely to the Base24 spec. No idea though how I would use it :)

In short, it looks like Channel is the correct way to populate and use headers.

Pieter

Op maandag 2 december 2013 18:53:57 UTC+2 schreef chhil:

chhil

unread,
Jan 3, 2014, 9:00:58 AM1/3/14
to jpos-users

Thanks Pieter. I was curious by the suggestion that was made and wondering if it is if any use.

-chhil

Alejandro Revilla

unread,
Jan 3, 2014, 3:51:49 PM1/3/14
to jPOS Users
Hi Pieter,

Your question about why we sometimes use a special header and sometimes we don't is very good, and I'm afraid I don't have a good answer. For easy-to-deal-with headers (such as BASE24's), we just use it as an opaque byte[], but some times we need more flexibility (i.e. to deal with VISA's rejected headers that are larger than the regular ones, or VISA's message length that goes inside the header, or its source/destination swap), so we created a custom handler, such as BASE1Header.


--
@apr


Reply all
Reply to author
Forward
0 new messages