日期:2014-05-20 浏览次数:20720 次
//接收银行返回的 商户通知 String NetpayNotifyMsg = request.getParameter("NetpayNotifyMsg"); BOCOMB2BMiddlemanClient B2BClient = new BOCOMB2BMiddlemanClient(); // boolean ret = B2BClient.initalize("D:\\mark_projects\\cookie\\WebRoot\\bankcomm\\ini\\sell\\B2BMerchant.xml"); boolean ret = B2BClient.initalize("C:\\Program Files\\Apache Software Foundation\\Tomcat 6.0\\webapps\\esteelbull\\bankcomm\\ini\\sell\\B2BMerchant.xml"); if (!ret) { String errmsg = B2BClient.getLastErr(); System.out.println("初始化失败:"); System.out.println(errmsg); return; } String srcData = null; BOCOMSignServer nss = B2BClient.getSignServer(); try{ srcData = nss.attachedVerify(NetpayNotifyMsg); }catch(Exception err){ System.out.println(err.getMessage()); } if(srcData == null) { System.out.println("原文为空"); } //转码 sun.misc.BASE64Decoder decoder = new sun.misc.BASE64Decoder(); String notifyMsg = new String(decoder.decodeBuffer(srcData)); System.out.println(notifyMsg); System.out.println("验签成功"); request.setAttribute("NetpayNotifyMsg",notifyMsg) ; //跳转到客户页面 request.getRequestDispatcher("bankcomm/notifyMsg.jsp").forward(request, response);