当前位置: 首页>>代码示例>>Java>>正文


Java GenericPackager类代码示例

本文整理汇总了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));
}
 
开发者ID:mmpedraza,项目名称:parserISO8583,代码行数:27,代码来源:BuildISOMessage.java

示例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);
	
}
 
开发者ID:mmpedraza,项目名称:netty-consumidor,代码行数:20,代码来源:ParseISO.java

示例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);
}
 
开发者ID:mmpedraza,项目名称:parserISO8583,代码行数:17,代码来源:ParseISOMessage.java

示例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();

}
 
开发者ID:vanjikumaran,项目名称:ISO8583Mediator,代码行数:20,代码来源:MockISO8583Server.java

示例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);
}
 
开发者ID:endymuhardin,项目名称:training-iso8583-jpos-2016-02,代码行数:20,代码来源:PackagerTests.java

示例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);
}
 
开发者ID:therealthom,项目名称:prosa-netty-consumidor,代码行数:21,代码来源:ParseISO.java

示例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);
}
 
开发者ID:endymuhardin,项目名称:training-iso8583-jpos-2016-02,代码行数:22,代码来源:PackagerTests.java

示例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);
}
 
开发者ID:endymuhardin,项目名称:training-iso8583-jpos-2016-02,代码行数:22,代码来源:PackagerTests.java


注:本文中的org.jpos.iso.packager.GenericPackager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。