spring与cxf整合配置webservice接口(以jaxws:server的方式配置)
ps:最近项目需要跟其他系统做同步,需要使用webservice来提供接口给其他系统调用;临时抱佛脚赶紧去网上找了下资料,发现用Endpoint的方式发布接口好容易哦;赶紧写了个例子做验证,发布成功。网上实例很多就不啰嗦了,这里说下通过Endpoint.publish的方式放到项目中去之后各种报错,网上找的解决办法都不灵;后来仔细研究项目代码发现,项目底层通过cxf和spring做了整合了,多了一堆cxf开头的jar包,所以报错;所以只要你项目中没有cxf开头的jar包,还是可以使用Endpoint这种非常简单的方式发布接口的;但Endpoint有一个弊端:就是接口复杂之后,暴露的wsdl接口xml样式会错乱,网上看到的,没实践过;
言归正传,下面说下spring和cxf整合的配置
1、定义webservice接口

2、定义接口实现类

3、让spring管理ServerFactoryBean(涉及项目资料,只贴出部分核心代码)

4、cxf集成到web容器中,在web.xml中添加如下代码

5、启动项目的同时发布webservice接口
6、在浏览器中输入http://ip:端口/项目名/ws/接口名?wsdl
ps:接口名就是<jaxws:server>标签中的address参数的值;
大家也可以参考这个资料,说的比我好:https://www.cnblogs.com/zhanxiaoyun/p/6144651.html
spring与cxf整合配置webservice接口(以jaxws:server的方式配置)的更多相关文章
- spring 与 CXF 整合 webservice 出现error “Unable to locate Spring NamespaceHandler for XML schema namespace” 总结
我试了多个版本的spring 发现 出现error : Unable to locate Spring NamespaceHandler for XML schema namespace 并非都是sp ...
- spring与axis2整合发布webservice
最近在研究整合spring框架和axis2发布webservice服务,由于本人也才学java不久,为了便于以后的查看,在这里记录下发布过程. 所需的工具包,spring.jar和axis2链接地址为 ...
- springboot 配置webservice接口
导入依赖的jar <!-- webservice cxf --> <dependency> <groupId>org.apache.cxf</groupId& ...
- Spring与CXF整合
1.首先引入CXF相关jar包以及spring相关jar包,因项目是maven项目,所以直接在pom.xml文件中引入以下依赖即可(以下只是CXF的依赖包,Spring的也要引入,相关的依赖参考我博客 ...
- Spring 与CXF整合(spring3.2,cxf3.1.11)
1,jar包导入,从官网下载zip文件后里面会有很多jar包,哪些必须哪些不是必须,我能力有限,从其他人那参考了导入的一下jar包. 2.配置相关文件 web.xml中配置servlet <se ...
- Spring 、 CXF 整合 swagger 【试炼】
官网:http://swagger.io/ http://swagger.io/specification/ 上面就是描述了什么是 SWAGGER OBJECT 2. 如何用jax-rs 注解方式产生 ...
- Spring和CXF整合时报Unsupported major.minor version 51.0异常
好吧,官网上有写:The current plan is that CXF 3.1 will no longer support Java 6 and will require Java 7 or n ...
- WebService--CXF以及CXF与Spring的整合(jaxws:server形式配置)
前言:好记性不如烂笔头,写博客的好处是,以前接触的东西即便忘记了,也可以从这里查找. Apache CXF 是一个开源的 Services 框架,CXF 帮助您利用 Frontend 编程 API 来 ...
- 使用cxf开发webservice接口
项目中经常用到开发webservice接口,及调用webService接口.这里讲解如何使用cxf开发webService接口. 一.webservice介绍及理解 webservice是一种跨平台, ...
随机推荐
- Java读取txt文件和覆盖写入txt文件和追加写入txt
//创建文件 public static void createFile(File filename) { try { if(!filename.exists()) { filename.create ...
- React开发实时聊天招聘工具 -第六章 登陆注册(2)
1.bodyParser和cookieParser: const bodyParser = require('body-parser') const cookieParser = require( ...
- scrapy框架中间件配置代理
scrapy框架中间件配置代理import random#代理池PROXY_http = [ '106.240.254.138:80', '211.24.102.168:80',]PROXY_http ...
- 比JLRoutes更强大更好用的iOS开源路由框架—FFRouter
目前iOS常用路由框架是JLRouter.HHRouter.MGJRouter. 但是这些路由库都各有不足,首先是JLRouter,用不到的功能繁多,而且基于遍历查找URL,效率低下.HHRouter ...
- SYSU 6356 Dispatching
Dispatching Time Limit: 3000ms Memory Limit: 262144KB This problem will be judged on SYSU. Original ...
- CentOS下安装.net core环境并部署WebAPI
1.安装CentOS 7 2.安装.net Core 2环境,参考官方文档:(建议采用SDK (tar.gz)安装) https://www.microsoft.com/net/download/li ...
- openssl之BIO系列之25---结束语
(作者:DragonKing, Mail: wzhah@263.net ,公布于:http://openssl.126.com之ope nssl专业论坛) 经过半个月左右,最终将BIO的结构和各个分支 ...
- OpenCascade Sweep Algorithm
OpenCascade Sweep Algorithm eryar@163.com Abstract. Sweeps are the objects you obtain by sweeping a ...
- CRSF Defense Using Content Injection Support By ModSecurity
The most advanced and imaginative use of the content injection feature is that devised byRyan C. Bar ...
- call() 和 apply() 的作用和区别
call, apply都属于Function.prototype的一个方法,它是JavaScript引擎内在实现的,因为属于Function.prototype,所以每个Function对象实例,也就 ...