Commit 8475ce47 by WeiCong

增加报文例子,充分展示api使用

parent affa1596
......@@ -54,16 +54,23 @@ public class Elcs_720_001_01Test {
System.out.println("Elcs_720_001_01签名部分==" + reqResult.getSignature());
System.out.println("Elcs_720_001_01报文体部分==" + reqResult.getBody());
System.out.println("Elcs_720_001_01完整报文==" + reqResult.getMessage());
System.out.println("Elcs_720_001_01模型json串==" + reqResult.getElcsModelForJson());
//这里模拟收到人行的报文(头部+签名域+报文体)进行解析
//支持三种API 1.字符串 2.字节数组 3.报文文件
//下面以Elcs_720_001_01完整报文字符串,调用字符串API解包
Result resResult=MsgUtil.unPackMessage(reqResult.getMessage());
System.out.println("本地保存完整报文:"+resResult.getMessageType());
resResult.saveMessageForXml("D:/elcs.720.001.01.xml");
//下面可以根据指定的路径,将报文保存到本地
// resResult.saveMessageForXml("D:/elcs.720.001.01.xml");
//扁平化结构,是把报文模型所有字段层级以.进行拼接,最后以map保存
System.out.println("本地保存完整报文模型扁平化结构:"+resResult.getElcsFlatHierarchy());
resResult.saveElcsFlatHierarchy("D:/elcs.720.001.01.json");
//下面可以根据指定的路径,将报文扁平化结构保存到本地
// resResult.saveElcsFlatHierarchy("D:/elcs.720.001.01.json");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment