Friday, 3 October 2014

Implementasi Menggunakan jPOS

Setelah kita mengetahui apa itu library jPOS, sekarang bagaimana penggunaan-nya secara nyata ? Pada bab kali ini, kita akan menulis ulang spesifikasi Network Management yang sebelum-nya sudah di implementasikan menggunakan Socket biasa. Nah untuk memulai-nya ada beberapa persiapan yang harus kita lakukan yaitu :

  • Persiapan Project
  • Pembuatan Aplikasi Server
  • Pembuatan Aplikasi Client


Persiapan Project

Sebagai langkah awal, tambahkanlah dahulu 2 buah library yaitu jdom-1.0.jar dan jpos.jar yang dapat diambil dari direktori jpos (yang bisa kita download melalui subversion) kedalam project. Setelah itu, buatlah 1 buah direktori dengan nama packager didalam direktori project dan pastekan kedua file dibawah ini :

<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT isopackager (isofield+,isofieldpackager*)*>
<!ATTLIST isopackager maxValidField CDATA #IMPLIED>
<!ATTLIST isopackager bitmapField CDATA #IMPLIED>
<!ATTLIST isopackager firstField CDATA #IMPLIED>
<!ATTLIST isopackager emitBitmap (true|false) #IMPLIED>
<!ATTLIST isopackager headerLength CDATA #IMPLIED>
<!-- isofield -->
<!ELEMENT isofield (#PCDATA)>
<!ATTLIST isofield id CDATA #REQUIRED>
<!ATTLIST isofield length CDATA #REQUIRED>
<!ATTLIST isofield name CDATA #REQUIRED>
<!ATTLIST isofield class NMTOKEN #REQUIRED>
<!ATTLIST isofield token CDATA #IMPLIED>
<!ATTLIST isofield pad (true|false) #IMPLIED>
<!-- isofieldpackager -->
<!ELEMENT isofieldpackager (isofield+,isofieldpackager*)*>
<!ATTLIST isofieldpackager id CDATA #REQUIRED>
<!ATTLIST isofieldpackager name CDATA #REQUIRED>
<!ATTLIST isofieldpackager length CDATA #REQUIRED>
<!ATTLIST isofieldpackager class NMTOKEN #REQUIRED>
<!ATTLIST isofieldpackager token CDATA #IMPLIED>
<!ATTLIST isofieldpackager pad (true|false) #IMPLIED>
<!ATTLIST isofieldpackager packager NMTOKEN #REQUIRED>
<!ATTLIST isofieldpackager emitBitmap (true|false) #IMPLIED>
<!ATTLIST isofieldpackager maxValidField CDATA #IMPLIED>
<!ATTLIST isofieldpackager bitmapField CDATA #IMPLIED>
<!ATTLIST isofieldpackager firstField CDATA #IMPLIED>
<!ATTLIST isofieldpackager headerLength CDATA #IMPLIED>


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE isopackager SYSTEM "genericpackager.dtd">
<!-- ISO 8583:1993 (ASCII) field descriptions for GenericPackager -->
<isopackager>
<isofield
id="0"
length="4"
name="Message Type Indicator"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="1"
length="16"
name="Bitmap"
class="org.jpos.iso.IFA_BITMAP"/>
<isofield
id="2"
length="19"
name="Primary Account number"
class="org.jpos.iso.IFA_LLNUM"/>
<isofield
id="3"
length="6"
name="Processing Code"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="4"
length="12"
name="Amount, Transaction"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="5"
length="12"
name="Amount, Reconciliation"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="6"
length="12"
name="Amount, Cardholder billing"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="7"
length="8"
name="Date and time, transmission"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="8"
length="8"
name="Amount, Cardholder billing fee"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="9"
length="8"
name="Conversion rate, Reconciliation"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="10"
length="8"
name="Conversion rate, Cardholder billing"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="11"
length="6"
name="Systems trace audit number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="12"
length="6"
name="Date and time, Local transaction"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="13"
length="4"
name="Date, Effective"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="14"
length="4"
name="Date, Expiration"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="15"
length="6"
name="Date, Settlement"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="16"
length="4"
name="Date, Conversion"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="17"
length="4"
name="Date, Capture"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="18"
length="4"
name="Merchant type"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="19"
length="3"
name="Country code, Acquiring institution"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="20"
length="3"
name="Country code, Primary account number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="21"
length="3"
name="Country code, Forwarding institution"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="22"
length="12"
name="Point of service data code"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="23"
length="3"
name="Card sequence number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="24"
length="3"
name="Function code"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="25"
length="4"
name="Message reason code"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="26"
length="4"
name="Card acceptor business code"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="27"
length="1"
name="Approval code length"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="28"
length="6"
name="Date, Reconciliation"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="29"
length="3"
name="Reconciliation indicator"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="30"
length="24"
name="Amounts, original"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="31"
length="99"
name="Acquirer reference data"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="32"
length="11"
name="Acquirer institution identification code"
class="org.jpos.iso.IFA_LLNUM"/>
<isofield
id="33"
length="11"
name="Forwarding institution identification code"
class="org.jpos.iso.IFA_LLNUM"/>
<isofield
id="34"
length="28"
name="Primary account number, extended"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="35"
length="37"
name="Track 2 data"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="36"
length="104"
name="Track 3 data"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="37"
length="12"
name="Retrieval reference number"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="38"
length="6"
name="Approval code"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="39"
length="3"
name="Action code"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="40"
length="3"
name="Service code"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="41"
length="8"
name="Card acceptor terminal identification"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="42"
length="15"
name="Card acceptor identification code"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="43"
length="99"
name="Card acceptor name/location"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="44"
length="99"
name="Additional response data"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="45"
length="76"
name="Track 1 data"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="46"
length="204"
name="Amounts, Fees"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="47"
length="999"
name="Additional data - national"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="48"
length="999"
name="Additional data - private"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="49"
length="3"
name="Currency code, Transaction"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="50"
length="3"
name="Currency code, Reconciliation"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="51"
length="3"
name="Currency code, Cardholder billing"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="52"
length="8"
name="Personal identification number [PIN] data"
class="org.jpos.iso.IFA_BINARY"/>
<isofield
id="53"
length="48"
name="Security related control information"
class="org.jpos.iso.IFA_LLBINARY"/>
<isofield
id="54"
length="120"
name="Amounts, additional"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="55"
length="255"
name="IC card system related data"
class="org.jpos.iso.IFA_LLLBINARY"/>
<isofield
id="56"
length="35"
name="Original data elements"
class="org.jpos.iso.IFA_LLNUM"/>
<isofield
id="57"
length="3"
name="Authorization life cycle code"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="58"
length="11"
name="Authorizing agent institution Id Code"
class="org.jpos.iso.IFA_LLNUM"/>
<isofield
id="59"
length="999"
name="Transport data"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="60"
length="999"
name="Reserved for national use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="61"
length="999"
name="Reserved for national use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="62"
length="999"
name="Reserved for private use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="63"
length="999"
name="Reserved for private use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="64"
length="8"
name="Message authentication code field"
class="org.jpos.iso.IFA_BINARY"/>
<isofield
id="65"
length="8"
name="Reserved for ISO use"
class="org.jpos.iso.IFA_BINARY"/>
<isofield
id="66"
length="204"
name="Amounts, original fees"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="67"
length="2"
name="Extended payment data"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="68"
length="3"
name="Country code, receiving institution"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="69"
length="3"
name="Country code, settlement institution"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="70"
length="3"
name="Country code, authorizing agent Inst."
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="71"
length="8"
name="Message number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="72"
length="999"
name="Data record"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="73"
length="6"
name="Date, action"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="74"
length="10"
name="Credits, number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="75"
length="10"
name="Credits, reversal number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="76"
length="10"
name="Debits, number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="77"
length="10"
name="Debits, reversal number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="78"
length="10"
name="Transfer, number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="79"
length="10"
name="Transfer, reversal number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="80"
length="10"
name="Inquiries, number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="81"
length="10"
name="Authorizations, number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="82"
length="10"
name="Inquiries, reversal number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="83"
length="10"
name="Payments, number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="84"
length="10"
name="Payments, reversal number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="85"
length="10"
name="Fee collections, number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="86"
length="16"
name="Credits, amount"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="87"
length="16"
name="Credits, reversal amount"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="88"
length="16"
name="Debits, amount"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="89"
length="16"
name="Debits, reversal amount"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="90"
length="10"
name="Authorizations, reversal number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="91"
length="3"
name="Country code, transaction Dest. Inst."
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="92"
length="3"
name="Country code, transaction Orig. Inst."
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="93"
length="11"
name="Transaction Dest. Inst. Id code"
class="org.jpos.iso.IFA_LLNUM"/>
<isofield
id="94"
length="11"
name="Transaction Orig. Inst. Id code"
class="org.jpos.iso.IFA_LLNUM"/>
<isofield
id="95"
length="99"
name="Card issuer reference data"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="96"
length="999"
name="Key management data"
class="org.jpos.iso.IFA_LLLBINARY"/>
<isofield
id="97"
length="17"
name="Amount, Net reconciliation"
class="org.jpos.iso.IFA_AMOUNT"/>
<isofield
id="98"
length="25"
name="Payee"
class="org.jpos.iso.IF_CHAR"/>
<isofield
id="99"
length="11"
name="Settlement institution Id code"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="100"
length="11"
name="Receiving institution Id code"
class="org.jpos.iso.IFA_LLNUM"/>
<isofield
id="101"
length="17"
name="File name"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="102"
length="28"
name="Account identification 1"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="103"
length="28"
name="Account identification 2"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="104"
length="100"
name="Transaction description"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="105"
length="16"
name="Credits, Chargeback amount"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="106"
length="16"
name="Debits, Chargeback amount"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="107"
length="10"
name="Credits, Chargeback number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="108"
length="10"
name="Debits, Chargeback number"
class="org.jpos.iso.IFA_NUMERIC"/>
<isofield
id="109"
length="84"
name="Credits, Fee amounts"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="110"
length="84"
name="Debits, Fee amounts"
class="org.jpos.iso.IFA_LLCHAR"/>
<isofield
id="111"
length="999"
name="Reserved for ISO use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="112"
length="999"
name="Reserved for ISO use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="113"
length="999"
name="Reserved for ISO use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="114"
length="999"
name="Reserved for ISO use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="115"
length="999"
name="Reserved for ISO use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="116"
length="999"
name="Reserved for national use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="117"
length="999"
name="Reserved for national use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="118"
length="999"
name="Reserved for national use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="119"
length="999"
name="Reserved for national use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="120"
length="999"
name="Reserved for national use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="121"
length="999"
name="Reserved for national use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="122"
length="999"
name="Reserved for national use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="123"
length="999"
name="Reserved for private use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="124"
length="999"
name="Reserved for private use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="125"
length="999"
name="Reserved for private use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="126"
length="999"
name="Reserved for private use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="127"
length="999"
name="Reserved for private use"
class="org.jpos.iso.IFA_LLLCHAR"/>
<isofield
id="128"
length="8"
name="Message authentication code field"
class="org.jpos.iso.IFA_BINARY"/>
</isopackager>
view raw iso93ascii.xml hosted with ❤ by GitHub


Jika sudah, harusnya tampilan dari NetBeans akan tampak seperti gambar dibawah ini :





Pembuatan Aplikasi Server

Sekarang buatlah sebuah class baru dan beri nama JPosServer dan simpan pada package id.web.martinusadyh.iso8583.jpos. Karena kita menggunakan library jPOS, maka implementasi Server kita tidak serumit yang pertama :) Dan inilah implementasi server kita yang menggunakan library jPOS :

package id.web.martinusadyh.iso8583.jpos;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.jpos.iso.BaseChannel;
import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISOPackager;
import org.jpos.iso.ISORequestListener;
import org.jpos.iso.ISOServer;
import org.jpos.iso.ISOSource;
import org.jpos.iso.ServerChannel;
import org.jpos.iso.channel.ASCIIChannel;
import org.jpos.iso.packager.GenericPackager;
/**
*
* @author Martinus Ady H <mrt.itnewbies@gmail.com>
*/
public class JPosServer implements ISORequestListener {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws ISOException {
String hostname = "localhost";
int portNumber = 12345;
// membuat sebuah packager
ISOPackager packager = new GenericPackager("packager/iso93ascii.xml");
// membuat channel
ServerChannel channel = new ASCIIChannel(hostname, portNumber, packager);
// membuat server
ISOServer server = new ISOServer(portNumber, channel, null);
server.addISORequestListener(new JPosServer());
new Thread(server).start();
System.out.println("Server siap menerima koneksi pada port [" + portNumber+"]");
}
public boolean process(ISOSource isoSrc, ISOMsg isoMsg) {
try {
System.out.println("Server menerima koneksi dari ["+((BaseChannel)isoSrc).getSocket().getInetAddress().getHostAddress()+"]");
if (isoMsg.getMTI().equalsIgnoreCase("1800")) {
acceptNetworkMsg(isoSrc, isoMsg);
}
} catch (IOException ex) {
Logger.getLogger(JPosServer.class.getName()).log(Level.SEVERE, null, ex);
} catch (ISOException ex) {
Logger.getLogger(JPosServer.class.getName()).log(Level.SEVERE, null, ex);
}
return false;
}
private void acceptNetworkMsg(ISOSource isoSrc, ISOMsg isoMsg) throws ISOException, IOException {
System.out.println("Accepting Network Management Request");
ISOMsg reply = (ISOMsg) isoMsg.clone();
reply.setMTI("1810");
reply.set(39, "00");
isoSrc.send(reply);
}
}


Melihat perbedaan antara penulisan menggunakan library jPOS dengan menggunakan Socket biasa ??? Jika belum, mari kita lihat bagaimana implementasi untuk client-nya :)


Pembuatan Aplikasi Client

Pembuatan aplikasi untuk client-nya pun tidak begitu susah :) , sekarang buatlah sebuah class baru dengan nama JPosClient dan simpan pada package id.web.martinusadyh.iso8583.jpos. Setelah itu, pastekan kode dibawah ini :

package id.web.martinusadyh.iso8583.jpos;
import java.io.IOException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.jpos.iso.ISOException;
import org.jpos.iso.ISOMUX;
import org.jpos.iso.ISOMsg;
import org.jpos.iso.ISOPackager;
import org.jpos.iso.ISORequest;
import org.jpos.iso.channel.ASCIIChannel;
import org.jpos.iso.packager.GenericPackager;
/**
*
* @author Martinus Ady H <mrt.itnewbies@gmail.com>
*/
public class JPosClient {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException, ISOException {
String hostname = "localhost";
int portNumber = 12345;
// membuat sebuah packager
ISOPackager packager = new GenericPackager("packager/iso93ascii.xml");
// membuat channel
ASCIIChannel channel = new ASCIIChannel(hostname, portNumber, packager);
ISOMUX isoMux = new ISOMUX(channel) {
@Override
protected String getKey(ISOMsg m) throws ISOException {
return super.getKey(m);
}
};
new Thread(isoMux).start();
// bikin network request
ISOMsg networkReq = new ISOMsg();
networkReq.setMTI("1800");
networkReq.set(3, "123456");
networkReq.set(7, new SimpleDateFormat("yyyyMMdd").format(new Date()));
networkReq.set(11, "000001");
networkReq.set(12, new SimpleDateFormat("HHmmss").format(new Date()));
networkReq.set(13, new SimpleDateFormat("MMdd").format(new Date()));
networkReq.set(48, "Tutorial ISO 8583 Dengan Java");
networkReq.set(70, "001");
ISORequest req = new ISORequest(networkReq);
isoMux.queue(req);
ISOMsg reply = req.getResponse(50*1000);
if (reply != null) {
System.out.println("Req ["+new String(networkReq.pack()) + "]");
System.out.println("Res ["+new String(reply.pack()) + "]");
}
}
}


Bagaimana tidak susah bukan ? Kode kita terlihat makin sederhana :) Nah jika sudah, sekarang coba lakukan proses Clean and Build dan jalankanlah JPosServer hingga muncul tampilan seperti dibawah ini :
run:
Server siap menerima koneksi pada port [12345]
Jika sudah menjumpai tampilan seperti diatas, sekarang jalankanlah aplikasi client-nya yaitu JPosClient. Jika tidak ada pesan kesalahan, maka kita akan melihat tampilan seperti dibawah ini pada sisi client :
run:
Req [1800A2380000000100000400000000000000123456201011090000010257411109029Tutorial ISO 8583 Dengan Java001]
Res [1810A2380000020100000400000000000000123456201011090000010257411109000029Tutorial ISO 8583 Dengan Java001]
Dan tampilan seperti ini pada sisi server :
run:
Server siap menerima koneksi pada port [12345]
Server menerima koneksi dari [127.0.0.1]
Accepting Network Management Request
Sekarang cobalah secara bergantian jalankan server yang menggunakan class ServerSocket biasa dengan client yang menggunakan library jPOS. Begitu juga sebaliknya, client dari class Socket dan server yang menggunakan library jPOS. Seharus-nya sudah tidak ada masalah lagi :)

18 comments:

  1. Replies
    1. "ISO 8583 ini adalah sebuah standart internasional untuk transaksi finansial. Dan standart atau protokol ini sudah sejak lama digunakan oleh perbankan untuk menjembatani komunikasi-nya (walaupun tidak menutup kemungkinan pihak selain bank menggunakan protokol ISO 8583), dengan adanya sebuah standart komunikasi seperti ini maka tidak menutup kemungkinan transaksi dapat tetap dilakukan antar pihak yang terkait walaupun menggunakan sistem atau bahasa pemrograman yang berbeda."

      Sudah dijelaskan di bab pendahuluan di depan sini[1]

      [1] http://iso8583tutorial.blogspot.com/2014/09/pendahuluan.html

      Delete
  2. Pak Martin ,
    terimakasih tutorialnya sangat membantu , tetapi kalau diimplementasikan di servlet kenapa file iso87ascii.xml nilai variabel ist null ya (InputStream ist = ClassLoader.getSystemResourceAsStream("packager/iso87ascii.xml")) .

    Sebaiknya file tersebut ditaruh dimana . Saya menggunakan netbean 7.2.1

    ReplyDelete
    Replies
    1. Klo pengalaman dulu, jika mo pake servlet. Maka file generic packager-nya bukan xml, melainkan dibuatkan sebuah class :)

      Delete
  3. Solved pak ,
    Setelah di coba ternyata dua file tsb (iso87ascii.xml dan dtd) di copy ke C:\Program Files\Apache Software Foundation\Apache Tomcat 7.0.27\bin\packager

    ReplyDelete
    Replies
    1. Klo saran saya, sebaiknya jangan seperti itu pak (ga standart dan mengotori direktori tomcat). Btw kenapa ga dibuat jadi class saja ?

      Delete
  4. ISOMux sekarang untuk Jpos versi 1.9.0 sudah tidak ada.
    Bisa tolong kasih tutorial untuk pengganti ISOMux jadi MUX atau QMux ?

    ReplyDelete
    Replies
    1. Ok pak, saya akan coba buatkan tutorial-nya kalau waktu sudah agak senggang ya pak.

      Delete
    2. Bagi yang masih menggunakan ISOMux dari milist nya JPOS memang disarankan untuk include library compatible (compat_1.5.2_x.x.x.jar)..

      btw blog ini sangat membantu, kebetulan pas lagi dapet proyek ISO8583.. thanks pak Martinus Ady :D

      Delete
  5. Thanks so much for this illustration

    ReplyDelete
  6. saya mau belajar, tapi setelh saya download jpos nya, koq nggak ada jpos.jar nya ya?
    versi jpos berapa pak, mohon bantuanya, kalau ada link linya bisa kh saya di kasih untuk mendpatkan jpos.jar nya
    terakhir saya download dr jpos.org
    terimakasih

    ReplyDelete
  7. iso 8583 dalam perancngan mobile payment berrti library dan mngenai iso 8583 diimplemntasikan pada webserver gateway, sedangkan pada aplikasi mobilenya implemntasi iso 8583 dibagian mnanya? masih rada bingun

    ReplyDelete
  8. Pak kalau pakai bahasa python bisa tidak? Kalau ada boleh tau referensinya?

    ReplyDelete
    Replies
    1. Terus terang saya blm pernah mainan pake python, tapi ketika search di google ada library ISO8583 untuk python disini[1]

      [1] https://pypi.python.org/pypi/ISO8583-Module/

      Delete
  9. This comment has been removed by the author.

    ReplyDelete
  10. cara merundown message request dan response gimana ya Mas ?

    misalkah hasilnya gini:

    DE2 = 16123456789012345
    DE7 = 123456
    ...dan seterusnya

    mohon pencerahan

    ReplyDelete
  11. apakah jpos ini support untuk konversi multiple ISO yg datang dalam 1 request?

    ReplyDelete