1、axis2 下载地址
axis2-1.6.2-bin.zip
http://mirror.esocc.com/apache//axis/axis2/java/core/1.6.2/axis2-1.6.2-bin.zip
axis2-1.6.2-war.zip
http://mirror.esocc.com/apache//axis/axis2/java/core/1.6.2/axis2-1.6.2-war.zip
2、部署 axis2-1.6.2-war 到tomcat
解压axis2-1.6.2-war.zip 得到 axis2.war 文件, 将 axis2.war 文件放到 tomcat 的 webapps 目录下,如下图
用org.apache.axis2jar包生成webservice客户端代码
c 配置环境变量AXIS2_HOME(到bin目录)
- d. 打开cmd命令行cd到axis2的bin目录;
- 运行命令:wsdl2java -uri http://test.bjp2p.com.cn:8843/platformService?wsdl
这时到axis2的bin目录下会发现出现了一个stub目录,如下图所示:
把这两个类复制到上次已经建立好的服务端工程里,如下图所示:
在项目中映入axis2依赖jar包
参考文章:http://m.blog.csdn.net/blog/z333205/23842335
报错:
The typeCreateResponse must implement the inherited abstract methodADBBean.serialize(QName, OMFactory,
MTOMAwareXMLStreamWriter)
axis2-adb.jar版本冲突
版本冲突
报错: java.lang.NoClassDefFoundError: org/apache/axis2/databinding/ADBException at com.voiinnov.puhuilicai.job.plugin.ProductRegistrationPlugin.ProductRegistration(ProductRegistrationPlugin.java:53) at com.voiinnov.puhuilicai.job.plugin.ProductRegistrationPlugin.executeTask(ProductRegistrationPlugin.java:32) at com.brick.warningCenter.core.WarningJobExecuter.doExecuteTask(md:213) at com.brick.warningCenter.core.WarningJobExecuter.execute(md:140) at com.brick.warningCenter.core.WarningJobExecuterThread.run(wd:123) /** * 给网贷协会提供的接口,获取放款时所有的投资用户 * @param paramMap * @return * @throws SQLException */ public List findTradingRecord(Map paramMap) throws SQLException{ return this.getSqlMap().queryForList(this.getNameSpace()+".findTradingRecord" ,paramMap); } /* *查询标的报备信息 */ @SuppressWarnings("unchecked") public List ProductRegistration() throws SQLException, ParseException{ Map paramMap = new HashMap(); DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:00:00"); Date date=new Date(); //开始时间 Date starttime= sdf.parse(sdf.format(new Date())); //结束时间 Calendar calendar = Calendar.getInstance(); calendar.set(Calendar.HOUR_OF_DAY, calendar.get(Calendar.HOUR_OF_DAY) + 1); Date endtime=sdf.parse(sdf.format(calendar.getTime())); paramMap.put("starttime",starttime); paramMap.put("endtime",endtime); return this.getSqlMap().queryForList(this.getNameSpace() + ".ProductRegistration", paramMap); }