本文整理汇总了Java中org.jpos.iso.packager.GenericPackager类的典型用法代码示例。如果您正苦于以下问题:Java GenericPackager类的具体用法?Java GenericPackager怎么用?Java GenericPackager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
GenericPackager类属于org.jpos.iso.packager包,在下文中一共展示了GenericPackager类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import org.jpos.iso.packager.GenericPackager; //导入依赖的package包/类
public static void main(String[] args) throws IOException, ISOException {
// Create Packager based on XML that contain DE type
GenericPackager packager = new GenericPackager("src/main/resources/basic.xml");
Logger logger = Logger.getLogger("log");
logger.setLevel(Level.INFO);
// Create ISO Message
ISOMsg isoMsg = new ISOMsg();
isoMsg.setPackager(packager);
isoMsg.setMTI("0200");
isoMsg.set(3, "201234");
isoMsg.set(4, "10000");
isoMsg.set(7, "110722180");
isoMsg.set(11, "123456");
isoMsg.set(44, "A5DFGR");
isoMsg.set(105, "VETEALDEMONIOISO8583 1234567890");
// print the DE list
logISOMsg(isoMsg);
// Get and print the output result
byte[] data = isoMsg.pack();
//System.out.println("RESULT : " + new String(data));
logger.info("RESULT : " + new String(data));
}
示例2: process
import org.jpos.iso.packager.GenericPackager; //导入依赖的package包/类
@Override
public void process(Exchange exchange) throws Exception,IOException {
// TODO Auto-generated method stub
GenericPackager packager = new GenericPackager(getClass().getClassLoader().getResourceAsStream("basic.xml"));
Logger logger = LoggerFactory.getLogger("netty - Consumidor");
// Print Input Data
String data = exchange.getIn().getBody(String.class);
logger.info("DATA : " + data);
// Create ISO Message
ISOMsg isoMsg = new ISOMsg();
isoMsg.setPackager(packager);
isoMsg.unpack(data.getBytes());
// print the DE list
String isoMsgString = logISOMsg(isoMsg);
exchange.getOut().setBody(isoMsgString);
}
示例3: main
import org.jpos.iso.packager.GenericPackager; //导入依赖的package包/类
public static void main(String[] args) throws IOException, ISOException {
// Create Packager based on XML that contain DE type
GenericPackager packager = new GenericPackager("src/main/resources/basic.xml");
// Print Input Data
String data = "0200B2200000001000000000000000800000201234000000010000011072218012345606A5DFGR031VETEALDEMONIOISO8583 1234567890";
System.out.println("DATA : " + data);
// Create ISO Message
ISOMsg isoMsg = new ISOMsg();
isoMsg.setPackager(packager);
isoMsg.unpack(data.getBytes());
// print the DE list
logISOMsg(isoMsg);
}
示例4: main
import org.jpos.iso.packager.GenericPackager; //导入依赖的package包/类
/**
* @param args
* the command line arguments
*/
public static void main(String[] args) throws ISOException {
String hostname = "localhost";
int portNumber = 5000;
ISOPackager packager = new GenericPackager(
XLinkISO8583Constant.JPOS_STREM_DEF);
ServerChannel channel = new ASCIIChannel(hostname, portNumber, packager);
ISOServer server = new ISOServer(portNumber, channel, null);
server.addISORequestListener(new MockISO8583Server());
System.out.println("ISO8583 server started...");
new Thread(server).start();
}
示例5: testAccountInquiry
import org.jpos.iso.packager.GenericPackager; //导入依赖的package包/类
@Test
public void testAccountInquiry() throws Exception {
ISOMsg msg = new ISOMsg("0200");
msg.set(2, "001");
msg.set(3, "341000");
msg.set(7, "1115112500");
msg.set(11, "123456");
msg.set(12, "112500");
msg.set(13, "1115");
msg.set(15, "1115");
msg.set(18, "6012");
msg.set(29, "C00000000");
msg.set(31, "C00000000");
msg.set(103, "001");
msg.setPackager(new GenericPackager("cfg/altopackager.xml"));
String msgString = new String(msg.pack());
System.out.println("Account Inquiry : "+msgString);
}
示例6: process
import org.jpos.iso.packager.GenericPackager; //导入依赖的package包/类
@Override
public void process(Exchange exchange) throws Exception, IOException {
Logger logger = LoggerFactory.getLogger("netty - consumidor");
GenericPackager packager = new GenericPackager(getClass().getClassLoader().getResourceAsStream("basic.xml"));
// Print Input Data
String data = exchange.getIn().getBody(String.class);
logger.info("DATA : " + data);
// Create ISO Message
ISOMsg isoMsg = new ISOMsg();
isoMsg.setPackager(packager);
logger.info("Unpacking... ");
isoMsg.unpack(data.getBytes());
// Print the DE list
String isoMsgString = logISOMsg(isoMsg);
exchange.getOut().setBody(isoMsgString);
}
示例7: testTopupRequest
import org.jpos.iso.packager.GenericPackager; //导入依赖的package包/类
@Test
public void testTopupRequest() throws Exception {
ISOMsg msg = new ISOMsg("0200");
msg.set(2, "001");
msg.set(3, "411000");
msg.set(4, "75000");
msg.set(7, "1116102500");
msg.set(11, "123456");
msg.set(12, "102500");
msg.set(13, "1116");
msg.set(15, "1116");
msg.set(18, "6012");
msg.set(29, "C00000000");
msg.set(31, "C00000000");
msg.set(102, "9876543210"); // akun sumber dana biasanya di 102
msg.set(103, "001"); // akun penerima dana biasanya di 103
msg.setPackager(new GenericPackager("cfg/altopackager.xml"));
String msgString = new String(msg.pack());
System.out.println("Topup Request : "+msgString);
}
示例8: testTransfer
import org.jpos.iso.packager.GenericPackager; //导入依赖的package包/类
@Test
public void testTransfer() throws Exception {
ISOMsg msg = new ISOMsg("0200");
msg.set(2, "001");
msg.set(3, "411000");
msg.set(4, "75000");
msg.set(7, "1116102500");
msg.set(11, "123456");
msg.set(12, "102500");
msg.set(13, "1116");
msg.set(15, "1116");
msg.set(18, "6012");
msg.set(29, "C00000000");
msg.set(31, "C00000000");
msg.set(102, "001"); // akun sumber dana biasanya di 102
msg.set(103, "123"); // akun penerima dana biasanya di 103
msg.setPackager(new GenericPackager("cfg/altopackager.xml"));
String msgString = new String(msg.pack());
System.out.println("Transfer Request : "+msgString);
}