为了与银行集成,我正在用j8583库(v1.17.0)实现iso消息,文档中说有可能创建IsoType.LLLLVAR格式的字段:

字段60上的xml配置是0800消息的下一个
<?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>我的工厂从资源中加载xml文件:
this.messageFactory = ConfigParser.createFromClasspathConfig("j8583-config.xml");我创建了一条0800消息
final IsoMessage req = this.messageFactory.newMessage(NET_INFO_REQUEST.getValue());我的debugString打印:
600005000008002220010000C00010990000081221183100000111237323330303336353933303VERSION_SOFT在没有打印长度的消息中,我理解它应该在字段60上具有以下格式:
0012VERSION_SOFT但只有印刷品:
VERSION_SOFT一个有趣的问题是,如果使用IsoType.LLLVAR在字段60上工作得很好:
600005000008002220010000C00010990000081221494800000111237323330303336353933303012VERSION_SOFT请参见:
012VERSION_SOFT有什么想法吗?
谢谢!
发布于 2022-08-17 17:04:08
我发现了错误,iso消息运行良好,我的错误是debugString方法,我调用了IsoMessage.debugString的一个IsoMessageFieldUtils实例
你好!!
https://stackoverflow.com/questions/73339960
复制相似问题