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是一种跨平台, ...
随机推荐
- [日常摸鱼]poj2417 DiscreteLogging-BSGS算法
在这题TLE了一天-T_T BSGS裸题-不知道为什么一直挂 第二天(也就是今天)换成黄学长博客里的写法就过掉了 题意:解关于$x$的方程:$a^x \equiv b \pmod{p}$,$p$为质数 ...
- 题解洛谷P1538【迎春舞会之数字舞蹈】
方法:暴力,判断,输出 本题为了更好理解建议各位可以复制样例来研究,甚至可以复制题解来测试思想,相信大家不会抄. 有什么不好的请大佬们在评论里指出,谢谢 #include <bits/stdc+ ...
- JavaScript var,let,const三个关键字的区别
var: 1)声明作用域:在函数内部,使用var定义一个变量(局部变量),在函数被调用完之后,该变量会被立即销毁.在定义变量时如果省略var,就会创建一个全局变量(不建议在局部作用域中定义全局变量,难 ...
- 这嘎哒真TM那啥!Python版东北话编程火爆网络
还记得那个刷爆朋友圈的那个文言文编程语言么? 这个项目是一位名为Huang Lingdong的大四学生创建的,当时,就连中科院计算所研究员.机器翻译领域知名专家刘群老师都赞叹道: 后生可畏 近日,Gi ...
- 如何使用阿里云云解析API实现动态域名解析,搭建私有服务器
原文地址:http://www.yxxrui.cn/article/116.shtml 未经许可请勿转载,如有疑问,请联系作者:yxxrui@163.com 公司的网络没有固定的公网IP地址,但是能够 ...
- bootstrap(一)栅格系统
中文网:http://www.bootcss.com/ 官网:http://v3.bootcss.com/ 需要准备:离线手册 和 软件包 项目中引用bootstrap.min.js压缩版和boo ...
- 最全的Visual Studio Code配置及使用教程
史上最全vscode配置使用教程 工欲善其事,必先利其器.想要优雅且高效的编写代码,必须熟练使用一款前端开发工具.但前端开发工具数不胜数,像HBuilder.Sublime Text.WebStorm ...
- 十大经典排序算法最强总结(含Java、Python码实现)
引言 所谓排序,就是使一串记录,按照其中的某个或某些关键字的大小,递增或递减的排列起来的操作.排序算法,就是如何使得记录按照要求排列的方法.排序算法在很多领域得到相当地重视,尤其是在大量数据的处理方面 ...
- Android Studio连接手机调试教程已决解
Android Studio连接手机调试教程 Windows电脑连接安卓手机需要下载安装驱动,确保电脑联上网络. 准备条件: 1.电脑上安装应用宝软件. 2.手机开发者选项里面打开USB调试,USB安 ...
- JAVA基础--数据类型和运算符总结
一,JAVA的数据类型 逻辑型----boolean 只允许取值true和false 字符型----char java采用unicode编码(utf16),每个字符占用两个字节 整数型----byte ...