基于spring ioc容器发布web服务,能够大大降低webservice实现过程,也能够更好的与企业级应用进行整合,
本文將和大家介绍如何基于spring和jax-ws发布webservice。
1.新建web服务接口和实现类
@webservice
public interface iuserwebservice {
public user queryuserbyid(@webparam(name = "userid") integer userid);
public user adduser(user user);
}
@component
@webservice(servicename = "userwebservice", endpointinterface = "cn.webservice.iuserwebservice")
public class userwebserviceimpl implements iuserwebservice {
public user queryuserbyid(integer userid) {
user user=new user();
user.setuserid(userid);
user.setname("张三");
return user;
}
public user adduser(user user) {
user.setuserid(200);
return user;
}
}
2.在web.xml文件中添加spring的监听器配置
contextconfiglocation
classpath:config/application*.xml
org.springframework.web.context.contextloaderlistener
3.发布
xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:p="http://www.springframework.org/schema/p" xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:cxf="http://cxf.apache.org/core"
xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd">
相关推荐
jax-ws与spring整合时需要添加两个jar包,即jaxws-spring-1.8.jar和xbean-spring-3.6.jar
jax-ws spring 实现webservice示例.docxjax-ws spring 实现webservice示例.docx
jax-ws spring 实现webservice示例
webservice jax-ws-spring 视频
这是我学习spring3.2.8 jax-ws时候做的基于注解的一个联系程序,使用tomcat6测试通过了,用soapui做的访问测试,希望可以帮助初次学习者部分的朋友理清思路。
使用jax-ws和jax-rs ,maven、java、spring 分别创建soap类型的webservice和restful类型的webservice,文档附有代码
jax-ws 与 spring 整合的简单例子:详情请查看http://poshidi.com/jax-ws-spring
自己写的spring jax-ws 手写的连接池,然后webservice接口传参传入有复杂的list传参(非json)
春天 使用 apache cxf 和 spring framework 的 webservice(jax-ws 和 jax-rs) apache cxf: : spring 框架: : 我想分享有关使用 spring framework 的 web 服务的更多信息。
webservice详细例子,详细请看: jax-ws 与 spring的整合(下) http://poshidi.com/jax-ws-spring2
不用说了,自己整理的。绝对实用,错过了是你的错
是一个开源的一个webservice,可以与spring无缝集成。支持soap1.1、1.2、resttful或者corba。 ##使用cxf实现jax-ws规范的webservice 服务端: 1、创建java工程,把cxf的jar包导入工程中 2、编写sei,在sei上添加@...
这个小实例有server和client的代码,server直接用myeclipse导入,然后添加spring2.0 aop和core,xfire1.2即可.client也是直接导入项目,然后导入jax-ws2.1api和jax-ws2.1 runtime libraries即可.这些包通过点击项目...
有大量简单的 api 用来快速地构建代码优先的 services,各种 maven 的插件也使集成更加容易,支持 jax-ws api ,支持 spring 2.0 更加简化的 xml 配置方式,等等。 4. 支持二进制和遗留协议:cxf 的设计是一种可插...
ssh rest ws jax-rs jersey 做的小网站后台及web service接口用到了kindeditor编辑器 goouploader控件 代码完整,有sql代码。
这个教程将了如何使用cxf开发webservice,包括jax-ws、jax-rs规范、数字证书、mtom附件传输、异步调用、异常处理、使用axis spring解决rpc/encode的问题向旧规范jax-rpc的兼容,第三版版教程在最一开始分别介绍了...
java ee 和 jax-ws 将是一个不错的选择,但我决定坚持使用 spring ws 和 spring boot 作为超级胶水。 作业涵盖了以下主题: 创建两个端点,根据简单过滤返回查询结果列表 使用 ws-security 进行基本身份验证 按照...
最近研究了一下spring webservice整合,由于第一次做这个,整合期间遇到了不少问题,在网上查找了好久也没找到完整实现的server和client的demo,有的问题折腾了我好几天,看到spring的凯发k8国际娱乐官网入口官网里面有人提相同的问题,...
从流行的汲取灵感,继承了一个完全更改的示例webservice-definition作为wsdl 展示如何在构建时使用jax-ws commons maven插件从wsdl生成jaxb类-只需运行 mvn clean generate-sources 首先使用springboot,cxf和...
最近研究了一下spring webservice整合,由于第一次做这个,整合期间遇到了不少问题,在网上查找了好久也没找到完整实现的server和client的demo,有的问题折腾了我好几天,看到spring的凯发k8国际娱乐官网入口官网里面有人提相同的问题,...