简体   繁体   中英

ISO8583 Android Studio

I am trying to send an ISO8583 message in Android Studio. Cloned a repository here

https://bitbucket.org/chochos/j8583/src/master/

and tried to run this client demo http://read.pudn.com/downloads141/sourcecode/java/612948/src/j8583/example/Client.java__.htm

I was getting a j8583/example/config.xml not found in classpath error in this line

mfact = ConfigParser.createFromClasspathConfig("j8583/example/config.xml");

I noticed that I didn't have the config.xml so I tried adding it in the res/raw, and using the directory to that folder instead.

The xml

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

<!-- These are the ISO headers to be prepended to the message types specified -->
<header type="0200">ISO015000050</header>
<header type="0210">ISO015000055</header>
<header type="0400">ISO015000050</header>
<header type="0410">ISO015000055</header>
<header type="0800">ISO015000015</header>
<header type="0810">ISO015000015</header>

<!-- The client example uses this to create requests -->
<template type="0200">
<field num="3" type="NUMERIC" length="6">650000</field>
<field num="32" type="LLVAR">456</field>
<field num="35" type="LLVAR">4591700012340000=</field>
<field num="43" type="ALPHA" length="40">SOLABTEST TEST-3 DF MX</field>
<field num="49" type="ALPHA" length="3">484</field>
<field num="60" type="LLLVAR">B456PRO1+000</field>
<field num="61" type="LLLVAR"> 1234P</field>
<field num="100" type="LLVAR">999</field>
<field num="102" type="LLVAR">ABCD</field>
</template>

<!-- The server example uses this to create the responses
we only need a few fields because the rest are copied from the request -->
<template type="0210">
<field num="60" type="LLLVAR">Fixed data from template</field>
<field num="70" type="ALPHA" length="3">ABC</field>
<field num="90" type="ALPHA" length="42">Field of length 42</field>
<field num="100" type="LLVAR">Fixed field</field>
<field num="102" type="LLVAR">Another fixed field</field>
<field num="126" type="LLLVAR">...and yet another fixed field.</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>

</j8583-config>

changed line in Main

mfact = ConfigParser.createFromClasspathConfig("res/raw/config.xml");

Then I was getting an uri not found error in this line of the config.xml

 <!DOCTYPE j8583-config PUBLIC "-//J8583//DTD CONFIG 1.0//EN"
    "http://j8583.sourceforge.net/j8583.dtd">

So, I went to File > Settings > Language & Frameworks > Schemas & DTD and added the Uri

It's compiling, the config was read and parsed yet the message was not sent to the server. In the logs for the ConfigParser.java I noticed that: binHeader = false binary, elem.getAttribute("type") = 0200, and the header = ISO015000050

I am trying to send an ISO8583 message in Android Studio. Cloned a repository here

https://bitbucket.org/chochos/j8583/src/master/

and tried to run this client demo http://read.pudn.com/downloads141/sourcecode/java/612948/src/j8583/example/Client.java__.htm

I was getting a j8583/example/config.xml not found in classpath error in this line

mfact = ConfigParser.createFromClasspathConfig("j8583/example/config.xml");

I noticed that I didn't have the config.xml so I tried adding it in the res/raw, and using the directory to that folder instead.

The xml

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

<!-- These are the ISO headers to be prepended to the message types specified -->
<header type="0200">ISO015000050</header>
<header type="0210">ISO015000055</header>
<header type="0400">ISO015000050</header>
<header type="0410">ISO015000055</header>
<header type="0800">ISO015000015</header>
<header type="0810">ISO015000015</header>

<!-- The client example uses this to create requests -->
<template type="0200">
<field num="3" type="NUMERIC" length="6">650000</field>
<field num="32" type="LLVAR">456</field>
<field num="35" type="LLVAR">4591700012340000=</field>
<field num="43" type="ALPHA" length="40">SOLABTEST TEST-3 DF MX</field>
<field num="49" type="ALPHA" length="3">484</field>
<field num="60" type="LLLVAR">B456PRO1+000</field>
<field num="61" type="LLLVAR"> 1234P</field>
<field num="100" type="LLVAR">999</field>
<field num="102" type="LLVAR">ABCD</field>
</template>

<!-- The server example uses this to create the responses
we only need a few fields because the rest are copied from the request -->
<template type="0210">
<field num="60" type="LLLVAR">Fixed data from template</field>
<field num="70" type="ALPHA" length="3">ABC</field>
<field num="90" type="ALPHA" length="42">Field of length 42</field>
<field num="100" type="LLVAR">Fixed field</field>
<field num="102" type="LLVAR">Another fixed field</field>
<field num="126" type="LLLVAR">...and yet another fixed field.</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>

</j8583-config>

changed line in Main

mfact = ConfigParser.createFromClasspathConfig("res/raw/config.xml");

Then I was getting an uri not found error in this line of the config.xml

 <!DOCTYPE j8583-config PUBLIC "-//J8583//DTD CONFIG 1.0//EN"
    "http://j8583.sourceforge.net/j8583.dtd">

So, I went to File > Settings > Language & Frameworks > Schemas & DTD and added the Uri

It's compiling, the config was read and parsed yet the message was not sent to the server. In the logs for the ConfigParser.java I noticed that: binHeader = false binary, elem.getAttribute("type") = 0200, and the header = ISO015000050

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