spring mvc + mybaties + mysql 完美整合cxf 实现webservice接口 (服务端、客户端)
spring-3.1.2、cxf-3.1.3、mybaties、mysql 整合实现webservice需要的完整jar文件 地址:http://download.csdn.net/detail/xuxiaoyu__/9868032
整合的过程其实很简单,通过简单的配置就可以,但是可悲的是 一堆问题都是由于jar缺失或者jar版本冲突引起的,所以附上全部jar文件 ↑↑↑
发布webservice服务:
第一步:编写接口和实现类
PlcDataDetail.java
1 package test;
2
3 import java.util.Date;
4
5 public class PlcDataDetail{
6
7 private Integer id;
8
9 private Integer plc_info_address_id;
10
11 private String value;
12
13 private Date create_time;
14
15 public Integer getId() {
16 return id;
17 }
18
19 public void setId(Integer id) {
20 this.id = id;
21 }
22
23 public Integer getPlc_info_address_id() {
24 return plc_info_address_id;
25 }
26
27 public void setPlc_info_address_id(Integer plc_info_address_id) {
28 this.plc_info_address_id = plc_info_address_id;
29 }
30
31 public String getValue() {
32 return value;
33 }
34
35 public void setValue(String value) {
36 this.value = value;
37 }
38
39 public Date getCreate_time() {
40 return create_time;
41 }
42
43 public void setCreate_time(Date create_time) {
44 this.create_time = create_time;
45 }
46 }
BaseWebService.java
1 package xd.service.plc;
2
3 import javax.jws.WebService;
4
5 import xd.persistence.beans.PlcDataDetail;
6
7 /**
8 * This class was generated by Apache CXF 3.1.6
9 * 2017-06-12T10:16:26.245+08:00
10 * Generated source version: 3.1.6
11 *
12 */
13 //必须为targetNamespace赋值,在另一个项目调用接口时,值必须一致,不然会匹配不到
14 //(可以把发布时默认的值赋值给targetNamespace)
15 @WebService(targetNamespace = "http://impl.plc.service.xd/")
16 public interface BaseWebService {
17
18 public PlcDataDetail readPlcData(Integer id);
19 }
BaseWebServiceImp.java
1 package xd.service.plc.impl;
2
3 import javax.jws.WebService;
4
5 import org.springframework.beans.factory.annotation.Autowired;
6
7 import xd.persistence.beans.PlcDataDetail;
8 import xd.service.plc.BaseWebService;
9 import xd.service.plc.PlcDataDetailService;
10
11
12 @WebService(endpointInterface="xd.service.plc.BaseWebService",serviceName="plcDataService")
13 public class BaseWebServiceImp implements BaseWebService {
14 @Autowired
15 private PlcDataDetailService plcDataDetailService;//业务处理类
16
17 public PlcDataDetail readPlcData(Integer id) {
18 PlcDataDetail plcDataDetail = new PlcDataDetail();
19 plcDataDetail = plcDataDetailService.selectbyId(id);
20 return plcDataDetail;
21 }
22
23 }
第二步:配置spring的核心文件 application-context.xml
添加命名空间以及配置接口发布信息:
1 xmlns:jaxws="http://cxf.apache.org/jaxws"
2 xmlns:jaxrs="http://cxf.apache.org/jaxrs"
3
4 xsi:schemaLocation="http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
5 http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"
6 <!-- address:暴露出来的地址,名称自己随便起 ;id属性此处不加也没问题-->
<!-- 如果要发布多个接口服务,再配置多个<jaxws/>即可,客户端调用时创建多个JaxWsPorxyFactoryBean对象就行了 -->
7 <jaxws:endpoint implementor="xd.service.plc.impl.BaseWebServiceImp" address="/ReadPlcData" />
配置web.xml:
<servlet-name>CXFService</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
</servlet>
<!-- 本系统的WebService路径必须以/ws/开头 -->
<servlet-mapping>
<servlet-name>CXFService</servlet-name>
<url-pattern>/ws/*</url-pattern>
</servlet-mapping>
访问:http://localhost:8080/ws 查看是否显示wsdl (项目通过tomcat配置不需要输入项目名,同学要注意) 结果:
客户端调用接口:
新建一个项目,把服务的接口类BaseWebService.java拷过来,jar也要拷过来哦,编写测试类:
BaseWebService.java
1 package test;
2
3 import javax.jws.WebService;
4
5 /**
6 * This class was generated by Apache CXF 3.1.6
7 * 2017-06-12T10:16:26.245+08:00
8 * Generated source version: 3.1.6
9 *
10 */
11 @WebService(targetNamespace = "http://impl.plc.service.xd/")
12 public interface BaseWebService {
13
14 public PlcDataDetail readPlcData(Integer id);
15 }
MyClient.java
1 package test;
2
3 import java.util.Properties;
4
5 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
6
7 public class MyClient {
8 public static void main(String args[]) {
9 //下面三行代码是系统初始化设置,若独立于服务接口外调用,不加也可以,如果在接口项目内调用需要加上,不然会报错
10 Properties props = System.getProperties();
11 props.setProperty("org.apache.cxf.stax.allowInsecureParser", "1");
12 props.setProperty("UseSunHttpHandler", "true");
13 //创建WebService客户端代理工厂
14 JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
15 //注册WebService接口
16 factory.setServiceClass(BaseWebService.class);
17 //设置WebService地址
18 factory.setAddress("http://localhost:8080/ws/ReadPlcData");
19 BaseWebService service = (BaseWebService) factory.create();
20 System.out.println(service.readPlcData(14).getValue());//传参查询
21 }
22 }
总结:网上的资源很多,有新资源,也有很久之前的了,在整合的时候出现了很多冲突,要注意自己项目中cxf的版本。比如刚开始顺着网上说的 在spring文件中配置下面三行资源,结果总是报错说找不到,其实在cxf 3.x 版本后就不需要再手动配置了,所以找问题要找最新的,老的不一定适用,用旧版本在开发过程中可能就是个大坑啊。
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
-----------------------------------------------此处非常有必要有个分割线---------------------------------------------
今天项目中需要写个对外的webservice接口,按照之前即上面的流程操作,结果悲催了,各种错误,只好再重新写了一个服务
框架 :spring mvc-4.3.7 、cxf-3.1.3、apache-maven-3.3.3
第一步、pom(!注意jar包冲突!)
必须:cxf-rt-frontend-jaxws、cxf-rt-transports-http、wsdl4j
删除: asm、XmlSchema
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.bwdz.fp.saas</groupId>
<artifactId>vat-web</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>vat-web</name>
<url>http://maven.apache.org</url> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- spring版本号 -->
<spring.version>4.3.7.RELEASE</spring.version>
<jjwt.version>0.6.0</jjwt.version>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.1.3</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>3.1.3</version>
</dependency>
<!--<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>3.1.3</version>
</dependency>-->
<dependency>
<groupId>com.alipay.sdk</groupId>
<artifactId>alipay-sdk-java</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>19.0</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>${jjwt.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<!-- 表示开发的时候引入,发布的时候不会加载此包 -->
<scope>test</scope>
</dependency>
<!-- spring核心包 -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- <dependency> <groupId>org.springframework</groupId> <artifactId>spring-asm</artifactId>
<version>${spring.version}</version> </dependency> -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-web -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>4.2.2.RELEASE</version>
</dependency> <dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-expression</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-orm</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>aopalliance</groupId>
<artifactId>aopalliance</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>1.6.8</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.7.0</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
<version>3.2.1</version>
</dependency>
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
<version>0.2</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.2</version>
</dependency>
<dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<version>3.0-rc4</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.7</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.7</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>1.6.1</version>
</dependency> <dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache-core</artifactId>
<version>2.6.10</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency> <dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.8</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpasyncclient</artifactId>
<version>4.0.1</version>
</dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.3</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore-nio</artifactId>
<version>4.4.3</version>
</dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5</version>
</dependency> <dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5</version>
</dependency>
<dependency>
<groupId>com.maxmind.geoip2</groupId>
<artifactId>geoip2</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>org.apache.xmlbeans</groupId>
<artifactId>xmlbeans</artifactId>
<version>2.5.0</version>
</dependency>
<!--<dependency>
<groupId>org.apache.ws.commons</groupId>
<artifactId>XmlSchema</artifactId>
<version>1.1</version>
</dependency>-->
<dependency>
<groupId>com.itextpdf.tool</groupId>
<artifactId>xmlworker</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.3.1</version>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.2.4</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.34</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-excelant</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
<version>3.9</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId>
<version>3.9</version>
</dependency> <dependency>
<groupId>org.apache.velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.7</version>
</dependency>
<!--<dependency>
<groupId>asm</groupId>
<artifactId>asm</artifactId>
<version>3.1</version>
</dependency>-->
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-all</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.0.9</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-core-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.8.5</version>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>1.9.13</version>
</dependency>
<dependency>
<groupId>net.sf.ezmorph</groupId>
<artifactId>ezmorph</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session</artifactId>
<version>1.3.0.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.session</groupId>
<artifactId>spring-session-data-redis</artifactId>
<version>1.3.0.RELEASE</version>
</dependency>
<dependency>
<groupId>net.sf.json-lib</groupId>
<artifactId>json-lib</artifactId>
<version>2.4</version>
<classifier>jdk15</classifier>
</dependency>
<dependency>
<groupId>javax.xml.rpc</groupId>
<artifactId>javax.xml.rpc-api</artifactId>
<version>1.1.1</version>
</dependency>
<!-- axis 1.4 jar start -->
<dependency>
<groupId>org.apache.axis</groupId>
<artifactId>axis</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-discovery</groupId>
<artifactId>commons-discovery</artifactId>
<version>0.2</version>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>wsdl4j</groupId>
<artifactId>wsdl4j</artifactId>
<version>1.6.2</version>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
<version>2.3.19</version>
</dependency>
<dependency>
<groupId>org.xhtmlrenderer</groupId>
<artifactId>core-renderer</artifactId>
<version>R8</version>
</dependency> </dependencies>
<profiles>
<profile>
<id>dev</id>
<properties>
<profiles.active>dev</profiles.active>
</properties>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
<profile>
<id>product</id>
<properties>
<profiles.active>product</profiles.active>
</properties>
</profile>
</profiles>
<build>
<finalName>vat-web</finalName>
<resources>
<resource>
<directory>src/main/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources</directory>
<excludes>
<exclude>product/*</exclude>
<exclude>dev/*</exclude>
</excludes>
</resource>
<resource>
<directory>src/main/resources/${profiles.active}/</directory>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<filesets>
<fileset>
<directory>src/main/webapp/WEB-INF/classes</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.8</source><!-- 源代码使用的开发版本 -->
<target>1.8</target><!-- 需要生成的目标class文件的编译版本 -->
<encoding>UTF-8</encoding>
<optimize>true</optimize>
<debug>true</debug>
<showDeprecation>true</showDeprecation>
<showWarnings>false</showWarnings>
</configuration>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.4</version>
<configuration>
<webappDirectory>src/main/webapp</webappDirectory>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build> </project>
第二步:编写服务端接口和实现类:
BaseWebService接口类:
package com.bwdz.fp.saas.service.test; import javax.jws.WebService; @WebService
public interface BaseWebService {
/**
* 此处有陷阱:返回类型如果是List<Map>会报错,
* 如果执意这样写,可以写个转换器,具体实现自行百度哈
**/
public String readPlcData(Integer id); }
BaseWebServiceImp实现类:
package com.bwdz.fp.saas.service.test; import com.bwdz.fp.saas.service.fphs.DzdzkZpsjTbService;
import org.springframework.beans.factory.annotation.Autowired; import javax.jws.WebService;
import java.util.ArrayList;
import java.util.List;
import java.util.Map; //@Service
@WebService(endpointInterface="com.bwdz.fp.saas.service.test.BaseWebService")
public class BaseWebServiceImp implements BaseWebService{
@Autowired
private DzdzkZpsjTbService dzdzkZpsjTbService; @Override
public String readPlcData(Integer id) {
List<Map> map = new ArrayList<>();
try{
map = dzdzkZpsjTbService.getAllMcpsh(id+"");
}catch (Exception e){ }
return map.toString();
}
}
第三步:配置spring的核心文件 application-context.xml
添加命名空间以及配置接口发布信息:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:task="http://www.springframework.org/schema/task"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/task
http://www.springframework.org/schema/task/spring-task.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<jaxws:endpoint id="myService"
implementor="com.bwdz.fp.saas.service.test.BaseWebServiceImp" address="/web-publish" >//address是暴漏的方法名,随便定义
</jaxws:endpoint>
第四步:配置web.xml:
<servlet>
<description>CXF Endpoint</description>
<display-name>cxf</display-name>
<servlet-name>cxf</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>cxf</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
最后一步就是见证奇迹的时候了:
访问:http://localhost:8080/vat-gap/services/
对外只要提供一个wsdl地址就可以了:http://localhost:8080/vat-gap/services/web-publish?wsdl
客户端调用 参考我之前写的文章 https://www.cnblogs.com/maxmoore/p/9965218.html
spring mvc + mybaties + mysql 完美整合cxf 实现webservice接口 (服务端、客户端)的更多相关文章
- 基于Apache CXF的Web Service服务端/客户端
转自:https://www.aliyun.com/zixun/wenji/1263190.html CXF服务端: package com.sean.server; import javax.jws ...
- 吴裕雄--天生自然JAVA SPRING框架开发学习笔记:SSM(Spring+Spring MVC+MyBatis)框架整合搭建详细步骤
因为 Spring MVC 是 Spring 框架中的一个子模块,所以 Spring 与 SpringMVC 之间不存在整合的问题.实际上,SSM 框架的整合只涉及 Spring 与 MyBatis ...
- Spring MVC Hibernate MySQL Integration(集成) CRUD Example Tutorial【摘】
Spring MVC Hibernate MySQL Integration(集成) CRUD Example Tutorial We learned how to integrate Spring ...
- SpringMVC4整合CXF发布WebService
SpringMVC4整合CXF发布WebService版本:SpringMVC 4.1.6,CXF 3.1.0项目管理:apache-maven-3.3.3 pom.xml <project x ...
- idea+maven+spring+cxf创建webservice应用(二)生成客户端程序
idea+maven+spring+cxf创建webservice应用(二)生成客户端程序,以上一篇为基础"idea+maven+spring+cxf创建webservice应用" ...
- SpringBoot2.1.6 整合CXF 实现Webservice
SpringBoot2.1.6 整合CXF 实现Webservice 前言 最近LZ产品需要对接公司内部通讯工具,采用的是Webservice接口.产品框架用的SpringBoot2.1.6,于是采用 ...
- spring集成cxf实现webservice接口功能
由于cxf的web项目已经集成了Spring,所以cxf的服务类都是在spring的配置文件中完成的.以下是步骤:第一步:建立一个web项目.第二步:准备所有jar包.将cxf_home\lib项目下 ...
- 2017.3.31 spring mvc教程(一)核心类与接口
学习的博客:http://elf8848.iteye.com/blog/875830/ 我项目中所用的版本:4.2.0.博客的时间比较早,11年的,学习的是Spring3 MVC.不知道版本上有没有变 ...
- 使用cxf开发webservice接口
项目中经常用到开发webservice接口,及调用webService接口.这里讲解如何使用cxf开发webService接口. 一.webservice介绍及理解 webservice是一种跨平台, ...
随机推荐
- Kafka消费者手动提交消息偏移
生产者每次调用poll()方法时,它总是返回由生产者写入Kafka但还没有消费的消息,如果消费者一致处于运行状态,那么分区消息偏移量就没什么用处,但是如果消费者发生崩溃或者有新的消费者加入群组,就会触 ...
- css 12-CSS3属性详解:动画详解
12-CSS3属性详解:动画详解 #前言 本文主要内容: 过渡:transition 2D 转换 transform 3D 转换 transform 动画:animation #过渡:transiti ...
- 工具-chrome相关-安装crx包及错误解决(99.3.1)
@ 目录 1.安装教程 2.程序包无效:"CRX_HEADER_INVALID" 1.安装教程 在浏览器上输入 chrome://extensions 并且选择开发者模式 将.cr ...
- openstack高可用集群17-openstack集成Ceph准备
Openstack集成Ceph准备 Openstack环境中,数据存储可分为临时性存储与永久性存储. 临时性存储:主要由本地文件系统提供,并主要用于nova虚拟机的本地系统与临时数据盘,以及存储gla ...
- 用Python分析北京市蛋壳公寓租房数据
本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,如有问题请及时联系我们以作处理 近期,蛋壳公寓"爆雷"事件持续发酵,期间因拖欠房东房租与租客退款,蛋壳公寓陷入讨 ...
- Python的精髓居然是方括号、花括号和圆括号!
和其他编程语言相比,什么才是Python独一无二的特色呢?很多程序员会说,缩进.的确,缩进是Python语言的标志性特点,但这只是外在的.形式上的.从语言特性层面讲,Python的特点是什么呢?我尝试 ...
- 使用NPOI读取Excel表格内容并进行修改
前言 网上使用NPOI读取Excel文件的例子现在也不少,本文就是参考网上大神们的例子进行修改以适应自己需求的. 参考博文 http://www.cnblogs.com/restran/p/38894 ...
- win10开启运行下显示历史操作记录
步骤 设置,隐私,常规,允许windows跟踪应用启动,以改进开始和搜索结果
- 简单了解一下 Nginx
一.Nginx 基本认识 1.Nginx 是什么? Nginx 是一款开源的.轻量级的.高性能的 HTTP 服务器 以及 反向代理服务器. 特点是 占有内存少.并发能力强. 2.Nginx 用来干什么 ...
- JavaSwing 船只停靠管理可视化(五)
JavaSwing 船只停靠管理可视化(一) JavaSwing 船只停靠管理可视化(二) JavaSwing 船只停靠管理可视化(三) JavaSwing 船只停靠管理可视化(四) JavaSwin ...