简体   繁体   中英

LLLLVAR not working on j8583 library usage

I'm doing an implementation of iso messages with j8583 library (v1.17.0) for an integration with a bank, in the documentation says a possibility to create fields with IsoType.LLLLVAR format:

在此处输入图像描述

My xml config over field 60 is next for 0800 message

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE j8583-config PUBLIC "-//J8583//DTD CONFIG 1.0//EN" "j8583.dtd">
<j8583-config>

    <!-- These are the ISO headers to be prepended to the message types specified -->
    <header type="0100">6000050000</header>
    <header type="0110" ref="0100"></header>
    <header type="0200" ref="0100"></header>
    <header type="0210" ref="0100"></header>
    <header type="0220" ref="0100"></header>
    <header type="0230" ref="0100"></header>
    <header type="0500" ref="0100"></header>
    <header type="0510" ref="0100"></header>
    <header type="0400" ref="0100"></header>
    <header type="0410" ref="0100"></header>
    <header type="0800" ref="0100"></header>
    <header type="0810" ref="0100"></header>

    <template type="0800">
            <field num="3" type="NUMERIC" length="6">990000</field>
            <field num="7" type="DATE10">0812215323</field>
            <field num="11" type="NUMERIC" length="6">000001</field>
            <field num="24" type="NUMERIC" length="3">112</field>
            <field num="41" type="ALPHA" length="8">37323330</field>
            <field num="42" type="ALPHA" length="15">303336353933303</field>
            <field num="60" type="LLLLVAR" >VERSION_SOFT</field>
    </template>
    <parse type="0800">
        <field num="3" type="NUMERIC" length="6" />
        <field num="7" type="DATE10" />
        <field num="11" type="NUMERIC" length="6" />
        <field num="24" type="NUMERIC" length="3" />
        <field num="41" type="ALPHA" length="8" />
        <field num="42" type="ALPHA" length="15" />
        <field num="60" type="LLLLVAR" length="999" />
    </parse>
</j8583-config>

My factory loads the xml file from resources:

this.messageFactory = ConfigParser.createFromClasspathConfig("j8583-config.xml");

I created a 0800 message iso

final IsoMessage req = this.messageFactory.newMessage(NET_INFO_REQUEST.getValue());

My debugString print:

600005000008002220010000C00010990000081221183100000111237323330303336353933303VERSION_SOFT

In the message not print the length, i understand that it should have the following format over field 60:

0012VERSION_SOFT

But only print:

VERSION_SOFT

A courious thing is if use IsoType.LLLVAR works fine over field 60:

600005000008002220010000C00010990000081221494800000111237323330303336353933303012VERSION_SOFT

See:

012VERSION_SOFT

Any idea?

Thanks!

i found the mistake, the iso message works fine, my error was the debugString metod, i called a IsoMessageFieldUtils instance of IsoMessage.debugString

Regards!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM