This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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 --> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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()) + "]"); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ISORequest req = new ISORequest(networkReq); | |
| isoMux.queue(req); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ISOServer server = new ISOServer(portNumber, channel, null); | |
| new Thread(server).start(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ISOMUX isoMux = new ISOMUX(channel) { | |
| @Override | |
| protected String getKey(ISOMsg m) throws ISOException { | |
| return super.getKey(m); | |
| } | |
| }; | |
| // jalankan ISOMUXnya | |
| new Thread(isoMux).start(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| ASCIIChannel channel = new ASCIIChannel(hostname, portNumber, packager); | |
| ... |