ssm框架结合axis2实例步骤
本文亲测;
1、从官网下载axis2相关api,地址是:http://axis.apache.org/axis2/java/core/download.html,我下载的是axis2-1.7.6-bin;
2、从axis2-1.7.6-bin里面找到webapp,WEB-INF,将conf,modules,service全部复制到项目下,如下图:

复制到WEB-INF下面(axis2-1.7.6-bin里面有);
3、在项目web.xml中加入axis2支持:
<!-- 加入Axis2支持 -->
<servlet>
<servlet-name>AxisServlet</servlet-name>
<servlet-class>org.apache.axis2.transport.http.AxisServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
4、接口发布java代码
package cn.yql8.sappi.service; import java.io.Serializable;
import java.util.List;
/**
* <!-- 公司代码主数据 -->
* @author Administrator
*
*/
public class Companycode {
public String getCompanycode(List<Masterdatas> list)throws Exception{
System.out.println("-----------------------------");
return "1";
} public static class Masterdatas implements Serializable{ /**
*
*/
private static final long serialVersionUID = 1L;
String MANDT; //客户端 主键
String BUKRS; //公司代码 主键
String BUTXT; //公司名称 主键
String LAND1; //国家代码 主键
String ORT01; //城市
String WAERS; //货币码
String SPRAS; //语言代码
String KTOPL; //帐目表
String ADRNR; //地址
public String getMANDT() {
return MANDT;
}
public void setMANDT(String mANDT) {
MANDT = mANDT;
}
public String getBUKRS() {
return BUKRS;
}
public void setBUKRS(String bUKRS) {
BUKRS = bUKRS;
}
public String getBUTXT() {
return BUTXT;
}
public void setBUTXT(String bUTXT) {
BUTXT = bUTXT;
}
public String getLAND1() {
return LAND1;
}
public void setLAND1(String lAND1) {
LAND1 = lAND1;
}
public String getORT01() {
return ORT01;
}
public void setORT01(String oRT01) {
ORT01 = oRT01;
}
public String getWAERS() {
return WAERS;
}
public void setWAERS(String wAERS) {
WAERS = wAERS;
}
public String getSPRAS() {
return SPRAS;
}
public void setSPRAS(String sPRAS) {
SPRAS = sPRAS;
}
public String getKTOPL() {
return KTOPL;
}
public void setKTOPL(String kTOPL) {
KTOPL = kTOPL;
}
public String getADRNR() {
return ADRNR;
}
public void setADRNR(String aDRNR) {
ADRNR = aDRNR;
} }
}
5、springmvc.xml中注入AXIS2支持
<bean id="applicationContext" class="org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder" />
6、pom.xml引入的对应的jar包
<!-- axis2.jar -->
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-adb-codegen</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-clustering</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-codegen</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-corba</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-fastinfoset</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-java2wsdl</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-jaxbri</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-jaxws</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-jibx</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-json</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-kernel</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-metadata</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-mtompolicy</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-saaj</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-soapmonitor-servlet</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-spring</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-http</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-transport-local</artifactId>
<version>${axis-version}</version>
</dependency>
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-xmlbeans</artifactId>
<version>${axis-version}</version>
</dependency>
7、services.xml中发布接口
<serviceGroup>
<service name="companycodeService" >
<description>
Test Companycode Example
</description>
<!-- 公司代码主数据 -->
<parameter name="ServiceClass">cn.yql8.sappi.service.Companycode</parameter>
<!-- <parameter name="SpringBeanName">emptyBoxService</parameter> -->
<!-- 公司代码主数据 -->
<operation name="getCompanycode">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</operation>
<messageReceivers>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
</messageReceivers> </service>
</serviceGroup>
8、浏览器地址访问:
http://localhost:8080/cgxtpt/services/CompanycodeService?wsdl
9、可以用SOAPUI进行测试;
ssm框架结合axis2实例步骤的更多相关文章
- SSM 框架快速整合实例--学生查询
一.快速准备 SSM 框架即 Spring 框架.SpringMVC 框架.MyBatis 框架,关于这几个框架的基础和入门程序,我前面已经写过几篇文章作为基础和入门介绍了.对于这 3 个框架还不熟悉 ...
- SSM框架快速整合实例——学生查询
一.快速准备 SSM 框架即 Spring 框架.SpringMVC 框架.MyBatis 框架,关于这几个框架的基础和入门程序,我前面已经写过几篇文章作为基础和入门介绍了.这里再简单的介绍一下: 1 ...
- SpringMVC笔记——SSM框架搭建简单实例
落叶枫桥 博客园 首页 新随笔 联系 订阅 管理 SpringMVC笔记——SSM框架搭建简单实例 简介 Spring+SpringMVC+MyBatis框架(SSM)是比较热门的中小型企业级项目开发 ...
- SSM框架整合模板
SSM框架整合--MAVEN依赖 spring方面(包含了springmvc): spring-webmvc:spring与mvc的整合依赖,主要包括spring的核心包和springmvc需要的包 ...
- SSM(Spring+SpringMVC+Mybatis)框架环境搭建(整合步骤)(一)
1. 前言 最近在写毕设过程中,重新梳理了一遍SSM框架,特此记录一下. 附上源码:https://gitee.com/niceyoo/jeenotes-ssm 2. 概述 在写代码之前我们先了解一下 ...
- SSM框架之整合(Maven实例)
有不少朋友在maven中因为pom文件依赖的事导致报错 今天我这个快速搭建ssm框架,确保在jdk7或者jdk8的环境,tomcat没什么要求.但如果要用jdk8的话,最好用run as中的serve ...
- SSM框架搭建步骤
首先要导入相关的jar包(spring\spring-core\spring-jdbc\spring-aop\spring-context\spring-webmvc\junit\commons-la ...
- 吴裕雄--天生自然JAVA SPRING框架开发学习笔记:SSM(Spring+Spring MVC+MyBatis)框架整合搭建详细步骤
因为 Spring MVC 是 Spring 框架中的一个子模块,所以 Spring 与 SpringMVC 之间不存在整合的问题.实际上,SSM 框架的整合只涉及 Spring 与 MyBatis ...
- SSM框架开发web项目系列(二) MyBatis真正的力量
前言 上篇SSM框架环境搭建篇,演示了我们进行web开发必不可少的一些配置和准备工作,如果这方面还有疑问的地方,可以先参考上一篇“SSM框架开发web项目系列(一) 环境搭建篇”.本文主要介绍MyBa ...
随机推荐
- 【C语言】练习1-21
题目来源:<The C programming language>中的习题 练习1-21:编写程序entab,将空格串替换为最好数量的制表符和空格,但要保持单词之间的间隔不变. 思路: 对 ...
- 你真的了解字典(Dictionary)吗? C# Memory Cache 踩坑记录 .net 泛型 结构化CSS设计思维 WinForm POST上传与后台接收 高效实用的.NET开源项目 .net 笔试面试总结(3) .net 笔试面试总结(2) 依赖注入 C# RSA 加密 C#与Java AES 加密解密
你真的了解字典(Dictionary)吗? 从一道亲身经历的面试题说起 半年前,我参加我现在所在公司的面试,面试官给了一道题,说有一个Y形的链表,知道起始节点,找出交叉节点.为了便于描述,我把上面 ...
- Oracle 12C -- in-database archiving
在同一张表中,通过将row置为inactive状态来实现数据的归档.数据库中,可以对那些inactive row进行压缩优化.在实现归档的同时,应用可以被限制只访问那些active状态的数据.默认情况 ...
- error nr.1045 access denied for user 'root'@'localhost' (using passwd:no)
在windows上卸载了mysql,再次重新安装的时候运行失败,并报以下错误: 解决办法: 1.服务里面停止Mysql服务. 2.卸载Mysql,删除MySQL的安装目录. 3.此外还要删除以下目录的 ...
- JAX-RS annotations
@Path("resource_path"):The @Path annotation defines the path to the base URL or resource_p ...
- 阿里云Redis公网连接的解决办法
https://help.aliyun.com/document_detail/43850.html ECS Windows 篇 目前云数据库 Redis 需要通过 ECS 的内网进行连接访问,如果您 ...
- jqgrid 设置为每行单选
jqgrid 不支持单选,自己自带了多选multiselect 那么单选怎么做呢,可以参考如下配置 multiselect: true, multiboxonly:true, gridComplete ...
- 我用Xamarin开发android应用,应用在真机上一打开就退出了
在解决方案管理器的项目上右键--属性--Android Options--Packaging将Use Shared Runtime前面的对勾取消即可.
- Retina屏的移动设备如何实现真正1px的线
前些日子总被人问起 iOS Retina 屏,设置 1px 边框,实际显示 2px,如何解决?原来一直没在意,源于自己根本不是像素眼……今天仔细瞅了瞅原生实现的边框和CSS设置的边框,确实差距不小…… ...
- HTML5 History API让ajax能回退到上一页
HTML5 History API提供了一种功能,能让开发人员在不刷新整个页面的情况下修改站点的URL.这个功能很有用,例如通过一段JavaScript代码局部加载页面的内容,你希望通过改变当前页面的 ...