resultElement2= itemElement.get(1).elements();
+ if("errormesage".equals(resultElement1.get(0).getName())){
+ finalResult = "错误信息:"+ resultElement1.get(0).getText()+",错误字段:"
+ + resultElement2.get(0).getText();
+ }else if("gmsfhm".equals(resultElement1.get(0).getName())){
+ finalResult = "身份证号码对比结果:"+ resultElement1.get(1).getText()+",姓名对比结果:"
+ + resultElement2.get(1).getText();
+ }
+ }
+ return finalResult;
+ } catch (Exception e) {
+ e.printStackTrace();
+ return "ERROR";
+ }
+ }
+}
diff --git a/src_tenwa/com/tenwa/lease/flow/project/validate/NciicClient.java b/src_tenwa/com/tenwa/lease/flow/project/validate/NciicClient.java
new file mode 100644
index 000000000..cfcc9fa97
--- /dev/null
+++ b/src_tenwa/com/tenwa/lease/flow/project/validate/NciicClient.java
@@ -0,0 +1,80 @@
+package com.tenwa.lease.flow.project.validate;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
+import java.lang.reflect.Proxy;
+import java.net.MalformedURLException;
+
+import org.apache.commons.httpclient.protocol.Protocol;
+import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
+import org.codehaus.xfire.client.Client;
+import org.codehaus.xfire.client.XFireProxy;
+import org.codehaus.xfire.client.XFireProxyFactory;
+import org.codehaus.xfire.service.Service;
+import org.codehaus.xfire.service.binding.ObjectServiceFactory;
+import org.codehaus.xfire.transport.http.CommonsHttpMessageSender;
+import org.codehaus.xfire.transport.http.EasySSLProtocolSocketFactory;
+import org.codehaus.xfire.util.dom.DOMOutHandler;
+
+public class NciicClient {
+
+ public static final String SERVICE_URL = "https://ws.nciic.org.cn/nciic_ws/services/";
+ /*public NciicClient() {
+ }*/
+ public static void main(String[] args) throws MalformedURLException {
+
+ try{
+
+ String IDNo = "140225199408171330";
+
+ String username = "张磊";
+
+ String license = ReadFile.ReadLine("D://app//license.txt");
+ System.out.println(license);
+ String inConditions = SoapRequest.XMLConfiguration(IDNo, username);
+
+ new NciicClient().executeClient("NciicServices", license , inConditions);
+
+ }catch(Exception e){
+ e.printStackTrace();
+ }
+ }
+ public static String executeClient(String serviceName, String license, String condition)
+ throws MalformedURLException {
+ long time = System.currentTimeMillis();
+ //调用生产环境接口时,需要采用https
+ ProtocolSocketFactory easy = new EasySSLProtocolSocketFactory();
+ Protocol protocol = new Protocol("https", easy, 443);
+ Protocol.registerProtocol("https", protocol);
+ //--核心服务NciicServices
+ Service serviceModel = new ObjectServiceFactory().create(ServiceInf.class, serviceName, null, null);
+ ServiceInf service = (ServiceInf) new XFireProxyFactory().create(serviceModel, SERVICE_URL + serviceName);
+ Client client = ((XFireProxy) Proxy.getInvocationHandler(service)).getClient();
+ client.addOutHandler(new DOMOutHandler());
+ client.setProperty(CommonsHttpMessageSender.GZIP_ENABLED, Boolean.TRUE);
+ // 忽略超时
+ client.setProperty(CommonsHttpMessageSender.HTTP_TIMEOUT, "0");
+ String result = null;
+ try {
+
+ /**
+ * 调用方法,针对不同的方法记得修改此处。否则报错
+ */
+ result = service.nciicCheck(license, condition);
+
+ System.out.println( result);
+ } catch (FileNotFoundException e){
+ e.printStackTrace();
+ } catch (IOException e){
+ e.printStackTrace();
+ } catch (Exception e){
+ e.printStackTrace();
+ }
+ time = System.currentTimeMillis() - time;
+ System.out.println("------out time -----"+time);
+ return result;
+ }
+}
diff --git a/src_tenwa/com/tenwa/lease/flow/project/validate/ServLtVO.java b/src_tenwa/com/tenwa/lease/flow/project/validate/ServLtVO.java
new file mode 100644
index 000000000..2403e6527
--- /dev/null
+++ b/src_tenwa/com/tenwa/lease/flow/project/validate/ServLtVO.java
@@ -0,0 +1,112 @@
+package com.tenwa.lease.flow.project.validate;
+/**
+ *
+ * 属性类
+ * @author zhangjieying
+ *
+ */
+public class ServLtVO {
+ /**
+ * 任务序列号
+ */
+ private String xlh;
+ /**
+ * 条件文件或结果文件
+ */
+ private byte[] fileBytes;
+ /**
+ * 文件状态
+ */
+ private String wjzt;
+
+ String bh = null;//原编号
+ String mc = null;//原单位名称
+ String dz = null;//原地址
+ String dh = null;//原电话
+ String dwmc = null;//单位名称
+ String dwdz = null;//单位地址
+ String ppbz = null;//匹配标志
+ String dhbz = null;//电话标志
+ String xltbz = null;//小灵通标志
+ String xsmc = null;//显示名称
+
+ public byte[] getFileBytes() {
+ return fileBytes;
+ }
+ public void setFileBytes(byte[] fileBytes) {
+ this.fileBytes = fileBytes;
+ }
+ public String getWjzt() {
+ return wjzt;
+ }
+ public void setWjzt(String wjzt) {
+ this.wjzt = wjzt;
+ }
+ public String getXlh() {
+ return xlh;
+ }
+ public void setXlh(String xlh) {
+ this.xlh = xlh;
+ }
+ public String getBh() {
+ return bh;
+ }
+ public void setBh(String bh) {
+ this.bh = bh;
+ }
+ public String getMc() {
+ return mc;
+ }
+ public void setMc(String mc) {
+ this.mc = mc;
+ }
+ public String getDz() {
+ return dz;
+ }
+ public void setDz(String dz) {
+ this.dz = dz;
+ }
+ public String getDh() {
+ return dh;
+ }
+ public void setDh(String dh) {
+ this.dh = dh;
+ }
+ public String getDwmc() {
+ return dwmc;
+ }
+ public void setDwmc(String dwmc) {
+ this.dwmc = dwmc;
+ }
+ public String getDwdz() {
+ return dwdz;
+ }
+ public void setDwdz(String dwdz) {
+ this.dwdz = dwdz;
+ }
+ public String getPpbz() {
+ return ppbz;
+ }
+ public void setPpbz(String ppbz) {
+ this.ppbz = ppbz;
+ }
+ public String getDhbz() {
+ return dhbz;
+ }
+ public void setDhbz(String dhbz) {
+ this.dhbz = dhbz;
+ }
+ public String getXltbz() {
+ return xltbz;
+ }
+ public void setXltbz(String xltbz) {
+ this.xltbz = xltbz;
+ }
+ public String getXsmc() {
+ return xsmc;
+ }
+ public void setXsmc(String xsmc) {
+ this.xsmc = xsmc;
+ }
+
+}
diff --git a/src_tenwa/com/tenwa/lease/flow/project/validate/ServiceInf.java b/src_tenwa/com/tenwa/lease/flow/project/validate/ServiceInf.java
new file mode 100644
index 000000000..50ec4ca05
--- /dev/null
+++ b/src_tenwa/com/tenwa/lease/flow/project/validate/ServiceInf.java
@@ -0,0 +1,90 @@
+package com.tenwa.lease.flow.project.validate;
+
+import javax.tools.FileObject;
+/**
+ *
+ * Title: 核心服务web service 接口
+ *
+ *
+ * Description: 升级改造项目
+ *
+ *
+ * Copyright: 2008-2010
+ *
+ *
+ * Company: NCIIC
+ *
+ *
+ *
+ * @author ZJS
+ * @version 2008年
+ */
+public interface ServiceInf {
+ //住址模糊截取
+ public String nciicAddrExactSearch(String inLicense, String inConditions)throws Exception;
+
+ // 核查
+ public String nciicCheck(String inLicense, String inConditions)throws Exception;
+
+ // 比对
+ public String nciicCompare(String inLicense, String inConditions)throws Exception;
+
+ // 组合查询
+ public String nciicExactSearch(String inLicense, String inConditions)throws Exception;
+ /*“nciicCourt” 组合多项核查方法,主要是高法院的姓名批量查询,根据需要的查询年限范围,大于1年时,则调用此方法。
+ *目前未使用此方法,因为高法院的协议查询年限范围是1年,年限范围可以登录nciic系统【服务管理】——>【系统参数】——>【姓名多项核查出生日期年限范围】代码07
+ */
+ public String nciicCourt(String inLicense,String inConditions) throws Exception;
+ // 精确查询
+ public String nciicCombineSearch(String inLicense, String inConditions)throws Exception;
+
+ // 统计分析
+ public String nciicStat(String inLicense, String inConditions)throws Exception;
+
+ // 二代证读卡器调用方法
+ public String nciicDiscern(String inLicense, String inConditions)throws Exception;
+
+ // 取得条件文件模板
+ public String nciicGetCondition(String inLicense) throws Exception;
+
+ //中国银行--流水号
+ public String nciicCheckChina(String inLicense, String inConditions)throws Exception;
+
+ // 天创旅客身份核查
+ public String nciicCheckHotel(String inLicense, String inConditions)throws Exception;
+
+ //籍贯比对
+ public String nciicBirthplaceCompare(String inLicense, String inConditions) throws Exception;
+
+ // 网闸特殊接口
+ public String nciicCheckFile(FileObject fileObject) throws Exception;
+ // 网闸特殊接口获取结果文件接口
+ public FileObject nciicGetFile(String inLicense, String id) throws Exception;
+
+ //同名同性
+ public String tmtx(java.lang.String licensecode, java.lang.String condition) throws Exception;
+
+ //--天创便携式手机核查
+ public String nciicCheckMobile(String inLicense, String inConditions)throws Exception;
+
+ //网民认证
+ public String wmrzCheck(String inLicense, String inConditions)throws Exception;
+
+ // 联通数据特殊接口
+ public FileObjectSetPhone nciicCheckSetPhone(FileObjectSetPhone fileObject) throws Exception;
+ public FileObjectSetPhone nciicCheckGetPhone(String inLicense, String id) throws Exception;
+
+ //扫描仪
+ public String nciicCheckScan(String inLicense, String inConditions,String keys)throws Exception;
+
+ public ServLtVO chinaUnicomGetPhone(ServLtVO vo) throws Exception;
+
+ public String faceProxy(int compressFlag,String galleryBase64Image,
+ int galleryMaxHeight,int galleryMaxSize,
+ String probeBase64Image,int probeImgType,
+ int probeMaxHeight,int probeMaxSize)throws Exception;
+
+ public String nciicDateCollection(String inLicense, String inConditions)throws Exception;
+
+
+}
diff --git a/src_tenwa/com/tenwa/lease/flow/project/validate/SoapRequest.java b/src_tenwa/com/tenwa/lease/flow/project/validate/SoapRequest.java
new file mode 100644
index 000000000..2c250744f
--- /dev/null
+++ b/src_tenwa/com/tenwa/lease/flow/project/validate/SoapRequest.java
@@ -0,0 +1,53 @@
+package com.tenwa.lease.flow.project.validate;
+
+public class SoapRequest {
+
+ public static String XMLConfiguration(String IDNo,String username) throws Exception {
+ //WebService接口地址?
+ //String wsdl = "https://ws.nciic.org.cn/nciic_ws/services/NciicServices";
+ //int timeout = 10000;
+ StringBuffer sb = new StringBuffer("");
+ //拼接soap请求的xml
+ //sb.append("");
+ /*sb.append("");
+ sb.append("");
+ sb.append("");
+ sb.append("");
+ sb.append("");*/
+ //sb.append("");
+ sb.append("");
+ sb.append("");
+ sb.append("安鹏国际融资租赁有限公司");
+ sb.append("");
+ sb.append("");
+ sb.append("公民身份号码");
+ sb.append("姓名");
+ sb.append("
");
+ sb.append("");
+ //入参身份证号码
+ sb.append(""+IDNo+"");
+ //入参姓名
+ sb.append(""+username+"");
+ sb.append("
");
+ sb.append("");
+ //sb.append("]]>");
+ /* sb.append("");
+ sb.append("");
+ sb.append("");*/
+
+ //System.out.println(sb);
+ //HttpClient发送SOAP请求
+ System.out.println("HttpClient 发送SOAP请求");
+
+ String xmldata = sb.toString();
+ //System.out.println(xmldata);
+ return xmldata;
+ }
+}