简体   繁体   English

J8583:ISO8583 MessageFactory 没有消息类型 0800 的解析指南

[英]J8583: ISO8583 MessageFactory has no parsing guide for message type 0800

I am using j8583 iso parser for ISO message (0800 2020000000800000 000000 000001 3239313130303031).我将 j8583 iso 解析器用于 ISO 消息 (0800 2020000000800000 000000 000001 3239313130303031)。

Below is my java code:下面是我的java代码:

public class ISOUtility {

    private static BufferedReader reader;

    private static String getMessage() throws IOException {
        if (reader == null) {
            reader = new BufferedReader(new InputStreamReader(System.in));
        }
     //   System.out.println("Paste your ISO8583 message here (no ISO headers): ");
        return "0800 2020000000800000 000000 000001 3239313130303031";
    }

    public static void main(String [] args) throws IOException, ParseException {

        final MessageFactory<IsoMessage> mf = new MessageFactory<IsoMessage>();

       if (1 == 0) {


        //  ConfigParser.createFromClasspathConfig("j8583.xml");
            ConfigParser.configureFromDefault(mf);


        }  else {

            String path="C:\\Users\\DELL\\workspace\\SolabParser\\j8583.xml";
            if (System.console() != null) {
                System.console().printf("Attempting to configure MessageFactory from %s...%n", path);

            }
            System.out.println("Messagefactory is done");
            String url = "j8583.xml";
            if (path.contains("://")) {
                System.out.println("else ");

                ConfigParser.configureFromUrl(mf, new URL(path));
            } else {
                System.out.println("else ");
                ConfigParser.configureFromUrl(mf, new File(path).toURI().toURL());
            }
        }
        //Now read messages in a loop
        String line = getMessage();
        while (line != null && line.length() > 0) {
            IsoMessage m = mf.parseMessage(line.getBytes(), 14);
            if (m != null) {
                System.out.printf("Message type: %04x%n", m.getType());
                System.out.println("FIELD TYPE    VALUE");
                for (int i = 2; i <= 128; i++) {
                    IsoValue<?> f = m.getField(i);
                    if (f != null) {
                        System.out.printf("%5d %-6s [", i, f.getType());
                        System.out.print(f.toString());
                        System.out.println(']');
                    }
                }
            }
            line = getMessage();
        }
    }
}

Below is config file.下面是配置文件。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE j8583-config PUBLIC "-//J8583//DTD CONFIG 1.0//EN"
    "http://j8583.sourceforge.net/j8583.dtd">
<j8583-config>
<!-- This is a test config file -->

<!-- These are the ISO headers to be prepended to the message types specified -->
<header type="0800"></header>

<template type="0280">
    <field num="3" type="NUMERIC" length="2">99</field>
</template>

<!-- The server example uses this to read the requests -->
<parse type="0200">
    <field num="3" type="NUMERIC" length="6" />
    <field num="4" type="AMOUNT" />
    <field num="7" type="DATE10" />
    <field num="11" type="NUMERIC" length="6" />
    <field num="12" type="TIME" />
    <field num="13" type="DATE4" />
    <field num="15" type="DATE4" />
    <field num="17" type="DATE_EXP" />
    <field num="32" type="LLVAR" />
    <field num="35" type="LLVAR" />
    <field num="37" type="NUMERIC" length="12" />
    <field num="41" type="ALPHA" length="16" />
    <field num="43" type="ALPHA" length="40" />
    <field num="48" type="LLLVAR" />
    <field num="49" type="ALPHA" length="3" />
    <field num="60" type="LLLVAR" />
    <field num="61" type="LLLVAR" />
    <field num="100" type="LLVAR" />
    <field num="102" type="LLVAR" />
</parse>

<!-- The client example uses this to read the responses -->
<parse type="0210">
    <field num="3" type="NUMERIC" length="6" />
    <field num="4" type="AMOUNT" />
    <field num="7" type="DATE10" />
    <field num="11" type="NUMERIC" length="6" />
    <field num="12" type="TIME" />
    <field num="13" type="DATE4" />
    <field num="15" type="DATE4" />
    <field num="17" type="DATE_EXP" />
    <field num="32" type="LLVAR" />
    <field num="35" type="LLVAR" />
    <field num="37" type="NUMERIC" length="12" />
    <field num="38" type="NUMERIC" length="6" />
    <field num="39" type="NUMERIC" length="2" />
    <field num="41" type="ALPHA" length="16" />
    <field num="43" type="ALPHA" length="40" />
    <field num="48" type="LLLVAR" />
    <field num="49" type="ALPHA" length="3" />
    <field num="60" type="LLLVAR" />
    <field num="61" type="LLLVAR" />
    <field num="70" type="ALPHA" length="3" />
    <field num="90" type="ALPHA" length="42" />
    <field num="100" type="LLVAR" />
    <field num="102" type="LLVAR" />
    <field num="126" type="LLLVAR" />
</parse>

<!-- this is for binary tests (message encoding AND fields) -->
<parse type="0600">
    <field num="4" type="AMOUNT" />
    <field num="7" type="DATE10" />
    <field num="11" type="NUMERIC" length="6" />
    <field num="41" type="BINARY" length="8" />
    <field num="42" type="BINARY" length="4" />
    <field num="43" type="ALPHA" length="40" />
    <field num="62" type="LLBIN" />
    <field num="63" type="LLBIN" />
    <field num="64" type="LLLBIN" />
    <field num="65" type="LLLBIN" />
    <field num="102" type="LLLVAR" />
</parse>

<parse type="0800">
    <field num="3" type="ALPHA" length="6"/>
    <field num="12" type="DATE4" legth="14">
    <field num="17" type="DATE4" length="8"/>
    <field num="11" type="NUMERIC" length="6"/>
    <field num="41" type="LLVAR" length="16"/>
</parse>

<parse type="0810" extends="0800">
    <field num="17" type="exclude"/>
    <field num="39" type="ALPHA" length="2"/>
</parse>

<parse type="0201">
    <field num="3" type="NUMERIC" length="19" />
</parse>
<parse type="0202">
    <field num="3" type="NUMERIC" length="22" />
</parse>
<parse type="0280">
    <field num="3" type="NUMERIC" length="2" />
</parse>

</j8583-config>

I am using the message of type "0800" for which I am not using any header.我正在使用类型为“0800”的消息,但我没有使用任何标题。

I am getting an error while compiling program: ISO8583 MessageFactory has no parsing guide for message type 0800编译程序时出现错误: ISO8583 MessageFactory 没有消息类型 0800 的解析指南

Any help will be appreciated.任何帮助将不胜感激。

在字段编号 12 上更改单词长度的拼写并用斜线关闭该标签,它缺少关闭斜线。

 <field num="12" type="DATE4" length="14" />

I guess you did mistake with Field 41 format.我猜您对 Field 41 格式有误。 It is different in your profile for different message types.对于不同的消息类型,它在您的个人资料中有所不同。

Here is possible interpretation of your sample message where BIT 41 is 16 HEX chars converted to 8 ASCII letters(numbers).这是您的示例消息的可能解释,其中 BIT 41 是 16 个十六进制字符转换为 8 个 ASCII 字母(数字)。

https://iso8583.info/cmd/CB/AUTO/msg?080020200000008000000000000000013239313130303031 https://iso8583.info/cmd/CB/AUTO/msg?080020200000008000000000000000013239313130303031

---
# Cheef's parser.
# Copyright (C) 2008-2016 Alexander Shevelev. https://iso8583.info/
# lib   : "/lib/CB/AUTO/" - CB2A Autorisation
# tool  : "msg"
# stat  : 10 nodes, 4 lookup tables, 100.00% passed (4/4)

msg:#"080020200000008000000000000000013239313130303031" # CB2A Autorisation message
- MTI: "0800" # Message Type ID. // Network management request
- DE000: "2020000000800000" # Primary bitmap // 3.11.41.
- BM0:#"0000000000013239313130303031" # Fields at Primary Bitmap
  - DE003:#"000000" # PC
    - S01: "00" # Transaction Code. // Purchase of goods or services
    - S02: "00" # Account, from. // Standard purchase
    - S03: "00" # Account, to. // Standard purchase
  - DE011: "000001" # STAN. // 1
  - DE041: "29110001" # CATI.

# run:0.030

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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