so I added the config.xml file in resource raw directory, changed this line of code
mfact = ConfigParser.createFromClasspathConfig("res/raw/config.xml"); , then added the http://j8583.sourceforge.net/j8583.dtd uri in File> Settings > Language $ Frameworks > Schemas $ DTDs and finally changed the socket ip and port in the Client main.
However I can't see
The ConfigParser is printing Adding {} ISO8583 header for type {}: {} false, binary : 0400 ISO015000050
so in this line of code
Log.i(TAG,"Adding {}ISO8583 header for type {}: {} " + binHeader + " binary : " + elem.getAttribute("type") + " " + header);
binHeader is returning false and elem.getAttribute("type") is returning 0400 and the header is returning ISO015000050
the config.xml has the following configurations
<?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></j8583-config>
<!-- These are the ISO headers to be prepended to the message types specified --><headertype="0200">ISO015000050</header><headertype="0210">ISO015000055</header><headertype="0400">ISO015000050</header><headertype="0410">ISO015000055</header><headertype="0800">ISO015000015</header><headertype="0810">ISO015000015</header><!-- The client example uses this to create requests --><templatetype="0200"><fieldnum="3"type="NUMERIC"length="6">650000</field><fieldnum="32"type="LLVAR">456</field><fieldnum="35"type="LLVAR">4591700012340000=</field><fieldnum="43"type="ALPHA"length="40">SOLABTEST TEST-3 DF MX</field><fieldnum="49"type="ALPHA"length="3">484</field><fieldnum="60"type="LLLVAR">B456PRO1+000</field><fieldnum="61"type="LLLVAR"> 1234P</field><fieldnum="100"type="LLVAR">999</field><fieldnum="102"type="LLVAR">ABCD</field></template><!-- The server example uses this to create the responseswe only need a few fields because the rest are copied from the request --><templatetype="0210"><fieldnum="60"type="LLLVAR">Fixed data from template</field><fieldnum="70"type="ALPHA"length="3">ABC</field><fieldnum="90"type="ALPHA"length="42">Field of length 42</field><fieldnum="100"type="LLVAR">Fixed field</field><fieldnum="102"type="LLVAR">Another fixed field</field><fieldnum="126"type="LLLVAR">...and yet another fixed field.</field></template><!-- The server example uses this to read the requests --><parsetype="0200"><fieldnum="3"type="NUMERIC"length="6"/><fieldnum="4"type="AMOUNT"/><fieldnum="7"type="DATE10"/><fieldnum="11"type="NUMERIC"length="6"/><fieldnum="12"type="TIME"/><fieldnum="13"type="DATE4"/><fieldnum="15"type="DATE4"/><fieldnum="17"type="DATE_EXP"/><fieldnum="32"type="LLVAR"/><fieldnum="35"type="LLVAR"/><fieldnum="37"type="NUMERIC"length="12"/><fieldnum="41"type="ALPHA"length="16"/><fieldnum="43"type="ALPHA"length="40"/><fieldnum="48"type="LLLVAR"/><fieldnum="49"type="ALPHA"length="3"/><fieldnum="60"type="LLLVAR"/><fieldnum="61"type="LLLVAR"/><fieldnum="100"type="LLVAR"/><fieldnum="102"type="LLVAR"/></parse><!-- The client example uses this to read the responses --><parsetype="0210"><fieldnum="3"type="NUMERIC"length="6"/><fieldnum="4"type="AMOUNT"/><fieldnum="7"type="DATE10"/><fieldnum="11"type="NUMERIC"length="6"/><fieldnum="12"type="TIME"/><fieldnum="13"type="DATE4"/><fieldnum="15"type="DATE4"/><fieldnum="17"type="DATE_EXP"/><fieldnum="32"type="LLVAR"/><fieldnum="35"type="LLVAR"/><fieldnum="37"type="NUMERIC"length="12"/><fieldnum="38"type="NUMERIC"length="6"/><fieldnum="39"type="NUMERIC"length="2"/><fieldnum="41"type="ALPHA"length="16"/><fieldnum="43"type="ALPHA"length="40"/><fieldnum="48"type="LLLVAR"/><fieldnum="49"type="ALPHA"length="3"/><fieldnum="60"type="LLLVAR"/><fieldnum="61"type="LLLVAR"/><fieldnum="70"type="ALPHA"length="3"/><fieldnum="90"type="ALPHA"length="42"/><fieldnum="100"type="LLVAR"/><fieldnum="102"type="LLVAR"/><fieldnum="126"type="LLLVAR"/></parse>
StrackTrace
2020-12-29 11:34:12.398 6322-6392/com.example.printdemo D/IsoClient Main: Reading config
2020-12-29 11:34:12.412 6322-6392/com.example.printdemo D/CreateFromClasspathConfig: ISO8583 Parsing config from classpath file {}res/raw/config.xml
2020-12-29 11:34:12.473 6322-6392/com.example.printdemo I/parse headers: Adding {}ISO8583 header for type {}: {}falsebinary :0200ISO015000050
2020-12-29 11:34:12.473 6322-6392/com.example.printdemo I/parse headers: Adding {}ISO8583 header for type {}: {}falsebinary :0210ISO015000055
2020-12-29 11:34:12.474 6322-6392/com.example.printdemo I/parse headers: Adding {}ISO8583 header for type {}: {}falsebinary :0400ISO015000050
2020-12-29 11:34:12.474 6322-6392/com.example.printdemo I/parse headers: Adding {}ISO8583 header for type {}: {}falsebinary :0410ISO015000055
2020-12-29 11:34:12.475 6322-6392/com.example.printdemo I/parse headers: Adding {}ISO8583 header for type {}: {}falsebinary :0800ISO015000015
2020-12-29 11:34:12.475 6322-6392/com.example.printdemo I/parse headers: Adding {}ISO8583 header for type {}: {}falsebinary :0810ISO015000015
2020-12-29 11:34:12.505 6322-6392/com.example.printdemo W/System.err: java.util.IllegalFormatConversionException: x != java.util.ArrayList
2020-12-29 11:34:12.506 6322-6392/com.example.printdemo W/System.err: at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4402)
2020-12-29 11:34:12.506 6322-6392/com.example.printdemo W/System.err: at java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2884)
2020-12-29 11:34:12.506 6322-6392/com.example.printdemo W/System.err: at java.util.Formatter$FormatSpecifier.print(Formatter.java:2838)
2020-12-29 11:34:12.506 6322-6392/com.example.printdemo W/System.err: at java.util.Formatter.format(Formatter.java:2523)
2020-12-29 11:34:12.506 6322-6392/com.example.printdemo W/System.err: at java.util.Formatter.format(Formatter.java:2458)
2020-12-29 11:34:12.507 6322-6392/com.example.printdemo W/System.err: at java.lang.String.format(String.java:2770)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.iso8583.MessageFactory.setParseMap(MessageFactory.java:744)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.iso8583.parse.ConfigParser.parseGuides(ConfigParser.java:362)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.iso8583.parse.ConfigParser.parse(ConfigParser.java:448)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.iso8583.parse.ConfigParser.createFromClasspathConfig(ConfigParser.java:94)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.iso8583.parse.ConfigParser.createFromClasspathConfig(ConfigParser.java:81)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.IsoClient.send(IsoClient.java:105)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.MainActivity.lambda$sendIsoMessageOnClick$1$MainActivity(MainActivity.java:73)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.-$$Lambda$MainActivity$jzAf5m209ydL3O0-0owgCwqr5fI.run(Unknown Source:2)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at java.lang.Thread.run(Thread.java:764)
2020-12-29 11:35:12.707 6322-6376/com.example.printdemo W/Adreno-ES20: <core_glfinish:34>: glFinish skipped: 0</core_glfinish:34>
I am working with android studio, and I'm trying to send an ISO8583 message to my SimHost
I pulled the Iso8583 source code from https://bitbucket.org/chochos/j8583/src/master/
and tried to set up a IsoClient with the example code found here http://read.pudn.com/downloads141/sourcecode/java/612948/src/j8583/example/Client.java__.htm
so I added the config.xml file in resource raw directory, changed this line of code
mfact = ConfigParser.createFromClasspathConfig("res/raw/config.xml"); , then added the http://j8583.sourceforge.net/j8583.dtd uri in File> Settings > Language $ Frameworks > Schemas $ DTDs and finally changed the socket ip and port in the Client main.
However I can't see
The ConfigParser is printing Adding {} ISO8583 header for type {}: {} false, binary : 0400 ISO015000050
so in this line of code
Log.i(TAG,"Adding {}ISO8583 header for type {}: {} " + binHeader + " binary : " + elem.getAttribute("type") + " " + header);
binHeader is returning false and elem.getAttribute("type") is returning 0400 and the header is returning ISO015000050
the config.xml has the following configurations
<?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></j8583-config>
StrackTrace
2020-12-29 11:34:12.398 6322-6392/com.example.printdemo D/IsoClient Main: Reading config
2020-12-29 11:34:12.412 6322-6392/com.example.printdemo D/CreateFromClasspathConfig: ISO8583 Parsing config from classpath file {}res/raw/config.xml
2020-12-29 11:34:12.473 6322-6392/com.example.printdemo I/parse headers: Adding {}ISO8583 header for type {}: {}falsebinary :0200ISO015000050
2020-12-29 11:34:12.473 6322-6392/com.example.printdemo I/parse headers: Adding {}ISO8583 header for type {}: {}falsebinary :0210ISO015000055
2020-12-29 11:34:12.474 6322-6392/com.example.printdemo I/parse headers: Adding {}ISO8583 header for type {}: {}falsebinary :0400ISO015000050
2020-12-29 11:34:12.474 6322-6392/com.example.printdemo I/parse headers: Adding {}ISO8583 header for type {}: {}falsebinary :0410ISO015000055
2020-12-29 11:34:12.475 6322-6392/com.example.printdemo I/parse headers: Adding {}ISO8583 header for type {}: {}falsebinary :0800ISO015000015
2020-12-29 11:34:12.475 6322-6392/com.example.printdemo I/parse headers: Adding {}ISO8583 header for type {}: {}falsebinary :0810ISO015000015
2020-12-29 11:34:12.505 6322-6392/com.example.printdemo W/System.err: java.util.IllegalFormatConversionException: x != java.util.ArrayList
2020-12-29 11:34:12.506 6322-6392/com.example.printdemo W/System.err: at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4402)
2020-12-29 11:34:12.506 6322-6392/com.example.printdemo W/System.err: at java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2884)
2020-12-29 11:34:12.506 6322-6392/com.example.printdemo W/System.err: at java.util.Formatter$FormatSpecifier.print(Formatter.java:2838)
2020-12-29 11:34:12.506 6322-6392/com.example.printdemo W/System.err: at java.util.Formatter.format(Formatter.java:2523)
2020-12-29 11:34:12.506 6322-6392/com.example.printdemo W/System.err: at java.util.Formatter.format(Formatter.java:2458)
2020-12-29 11:34:12.507 6322-6392/com.example.printdemo W/System.err: at java.lang.String.format(String.java:2770)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.iso8583.MessageFactory.setParseMap(MessageFactory.java:744)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.iso8583.parse.ConfigParser.parseGuides(ConfigParser.java:362)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.iso8583.parse.ConfigParser.parse(ConfigParser.java:448)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.iso8583.parse.ConfigParser.createFromClasspathConfig(ConfigParser.java:94)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.iso8583.parse.ConfigParser.createFromClasspathConfig(ConfigParser.java:81)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.IsoClient.send(IsoClient.java:105)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.MainActivity.lambda$sendIsoMessageOnClick$1$MainActivity(MainActivity.java:73)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at com.example.printdemo.-$$Lambda$MainActivity$jzAf5m209ydL3O0-0owgCwqr5fI.run(Unknown Source:2)
2020-12-29 11:34:12.508 6322-6392/com.example.printdemo W/System.err: at java.lang.Thread.run(Thread.java:764)
2020-12-29 11:35:12.707 6322-6376/com.example.printdemo W/Adreno-ES20: <core_glfinish:34>: glFinish skipped: 0</core_glfinish:34>
nevermind