标签:
package com.creditharmony.adapter.testCase.ca; import org.junit.Test; import com.alibaba.druid.util.StringUtils; import com.creditharmony.adapter.bean.in.CASignlInfo; import com.creditharmony.adapter.bean.out.CAOutInfo; import com.creditharmony.adapter.constant.CAKeyWordType; import com.creditharmony.adapter.constant.ServiceType; import com.creditharmony.adapter.core.client.ClientPoxy; public class CASignReqServiceTest { /** * 代理方式 * 2015年12月16日 */ @Test public void test02() { CASignlInfo casinfo = new CASignlInfo(); casinfo.setSignerName("12"); casinfo.setIDCardNum("410522199004025815"); casinfo.setPdfID("{E06F1652-0000-C512-BF16-EBB403F6EB73}");//根据该id从filenet上获取需要签章的pdf casinfo.setSubType("subType000002"); casinfo.setBatchNo("batchNo000002"); casinfo.setBusinessType("approve"); casinfo.setKeyWord(CAKeyWordType.QZ.getType());//关键字必须与pdf上一致才能签章成功 ClientPoxy service = new ClientPoxy(ServiceType.Type.CA_AGENT_SIGN_SERVICE); CAOutInfo outInfo = (CAOutInfo) service.callService(casinfo); if(StringUtils.equals(outInfo.getRetMsg(), "0000")){ //成功生成签名文件 System.err.println("上传成功,docId:"+outInfo.getDocId()); } } /** * 企业电子签章 * 2016年3月8日 * By yourname */ @Test public void test03() { CASignlInfo casinfo = new CASignlInfo(); //casinfo.setPdfID("{E06F1652-0000-C512-BF16-EBB403F6EB73}"); casinfo.setPdfID("{F0BBD053-0000-CC17-816E-A08DFCED9267}");//{90EBBB53-0000-CE19-837F-B8E4A1D69A87} casinfo.setSubType("subType001"); casinfo.setBatchNo("batchNo001"); casinfo.setBusinessType("fortune"); casinfo.setTid("xhtest");//xj,代表老总个人签名。xhtest,代表惠*公司签章 ClientPoxy service = new ClientPoxy(ServiceType.Type.CA_UNIT_SIGN_SERVICE); CAOutInfo outInfo = (CAOutInfo) service.callService(casinfo); //数字签名的问题是因为jar包不匹配,重新下Maven里org-bjca的包 if(StringUtils.equals(outInfo.getRetCode(), "0000")){ //成功生成签名文件 System.out.println("返回docId:"+outInfo.getDocId()); } } }
标签:
原文地址:http://www.cnblogs.com/hoge/p/5345225.html