All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.playboy.demo.DemoXml Maven / Gradle / Ivy

The newest version!
package com.playboy.demo;

public class DemoXml {
	
	/**
	 * 模拟组织报文,这个只是参考方法,没有借鉴意义
	 * 
	 * @return
	 */
	public static String getXML(String msg) {
		StringBuffer headXml = new StringBuffer();
		headXml = headXml.append("v1.0CB001")
				.append("100000200000").append("200000").append("CZSB")
				.append("CB0011000002017050500000001")
				.append("CB0011000002017050500000001").append("1")
				.append("1").append("1")
				.append("20170505 12:23:23").append("");

		StringBuffer bodyXml = new StringBuffer();
		bodyXml = bodyXml.append("123218937123财政局")
				.append("中国银行杭州分行").append("123218937123-01")
				.append("RMB").append("").append("")
				.append("");

		StringBuffer xml = new StringBuffer("");
		xml = xml.append(headXml).append(bodyXml).append("");
		return xml.toString() +"&"+ msg;
	}
	
	public static String parseXml(String xml){
		String[] split = xml.split("&");
		return split[1];
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy