Spring整合CXF步骤,Spring实现webService,spring整合WebService
Spring整合CXF步骤
Spring实现webService,
spring整合WebService
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
蕃薯耀 2015年9月28日 16:40:28 星期一
http://fanshuyao.iteye.com/
一、在web.xml配置CXFServlet
<servlet>
<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>/ws/*</url-pattern>
</servlet-mapping>
其中url-pattern不能配置为/ws/**
二、在web.xml配置ContextLoaderListener
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:spring.xml</param-value>
</context-param> <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
三、在spring.xml配置jaxws命名(xmlns:jaxws="http://cxf.apache.org/jaxws")
<?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:jaxws="http://cxf.apache.org/jaxws"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
四、在spring.xml配置webService服务(serviceClass配置的是类,serviceBean配置的是bean)
<!--
请求地址为:http://localhost:8080/cxf2.7-spring/ws/person
wsdl地址为:http://localhost:8080/cxf2.7-spring/ws/person?wsdl
其中ws是在web.xml中CXFServlet配置的路径
-->
<jaxws:server address="/person" serviceClass="com.spring.cxf.service.Impl.PersonServiceImpl">
<!--
<jaxws:serviceBean>
<bean class="com.spring.cxf.service.Impl.PersonServiceImpl"></bean>
</jaxws:serviceBean>
-->
<jaxws:inInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingInInterceptor"></bean>
</jaxws:inInterceptors>
<jaxws:outFaultInterceptors>
<bean class="org.apache.cxf.interceptor.LoggingOutInterceptor"></bean>
</jaxws:outFaultInterceptors>
</jaxws:server>
五、在实现类中加@WebService注解,声明该类为webService服务
@WebService(name="cccc",serviceName="dddd")
@Service
public class PersonServiceImpl implements PersonService{ }
六、访问http://localhost:8080/cxf2.7-spring/ws/时,会把所有服务都列出来。
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>.
蕃薯耀 2015年9月28日 16:40:28 星期一
http://fanshuyao.iteye.com/
Spring整合CXF步骤,Spring实现webService,spring整合WebService的更多相关文章
- Spring整合CXF之发布WebService服务
今天我们来讲下如何用Spring来整合CXF,来发布WebService服务: 给下官方文档地址:http://cxf.apache.org/docs/writing-a-service-with-s ...
- Spring整合CXF,发布RSETful 风格WebService(转)
Spring整合CXF,发布RSETful 风格WebService 这篇文章是承接之前CXF整合Spring的这个项目示例的延伸,所以有很大一部分都是一样的.关于发布CXF WebServer和Sp ...
- Spring整合CXF,发布RSETful 风格WebService
原文地址:http://www.cnblogs.com/hoojo/archive/2012/07/23/2605219.html 这篇文章是承接之前CXF整合Spring的这个项目示例的延伸,所以有 ...
- Java WebService 教程系列之 Spring 整合 CXF
Java WebService 教程系列之 Spring 整合 CXF 一.引入 jar 包 <dependency> <groupId>org.apache.cxf</ ...
- spring与cxf整合配置webservice接口(以jaxws:server的方式配置)
ps:最近项目需要跟其他系统做同步,需要使用webservice来提供接口给其他系统调用:临时抱佛脚赶紧去网上找了下资料,发现用Endpoint的方式发布接口好容易哦:赶紧写了个例子做验证,发布成功. ...
- Spring boot 整合CXF webservice 遇到的问题及解决
将WebService的WSDL生成的代码的命令: wsimport -p com -s . com http://localhost:8080/service/user?wsdl Spring bo ...
- So easy Webservice 8.spring整合CXF 发布WS
1.添加jar包(cxf的jar包中包含了spring的jar包),添加spring配置文件 2.web.xml中配置CXFServlet,过滤WS服务的地址 <!-- 配置CXFServlet ...
- 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整合CXF发布及调用WebService
这几天终于把webService搞定,下面给大家分享一下发布webService和调用webService的方法 添加jar包 (官方下载地址:http://cxf.apache.org/downlo ...
随机推荐
- [转贴]JAVA :CXF 简介
Apache CXF = Celtix + XFire,Apache CXF 的前身叫 Apache CeltiXfire,现在已经正式更名为 Apache CXF 了,以下简称为 CXF.CXF 继 ...
- 窗口的子类化与超类化——子类化是窗口实例级别的,超类化是在窗口类(WNDCLASS)级别的
1. 子类化 理论:子类化是这样一种技术,它允许一个应用程序截获发往另一个窗口的消息.一个应用程序通过截获属于另一个窗口的消息,从而实现增加.监视或者修改那个窗口的缺省行为.子类化是用来改变或者扩展一 ...
- Android CoordinatorLayout + AppBarLayout(向上滚动隐藏指定的View)
在新的Android Support Library里面,新增了CoordinatorLayout, AppBarLayout等. 实现的效果: 向下滚动RecylerView,Tab会被隐藏,向上滚 ...
- Php使用sqlite
php sqlite文档:http://php.net/manual/en/book.sqlite.php sql:http://www.php100.com/html/webkaifa/PHP/PH ...
- 【HDOJ】3234 Exclusive-OR
并查集.对于对元素赋值操作,更改为I p n v.令val[n]=0(任何数与0异或仍为原值).考虑fa[x] = fx, fa[y] = fy.如果使得fa[fx] = fy, 那么val[fx] ...
- 【CF】110 Div.1 B. Suspects
这题目乍眼一看还以为是2-sat.其实很水的,O(n)就解了.枚举每个人,假设其作为凶手.观察是否满足条件.然后再对满足的数目分类讨论,进行求解. /* 156B */ #include <io ...
- oracle 回收站
oracle10g,在pl/sql中选中删除后会出现类似:BIN$nJ5JuP9cQmqPaArFei384g==$0的表. 1.查看回收站 select * from user_recyclebin ...
- 在 SharePoint 2010 中访问数据
转:http://blog.banysky.net/?p=81001 数据访问的关键方法有哪些? | 使用查询类 | 使用 SPQuery | 使用 SPSiteDataQuery | 使用 LINQ ...
- Windows SharePoint Services 默认母版页
转:http://msdn.microsoft.com/zh-cn/library/ms467402(v=office.12).aspx 最终用户可以自定义的 Windows SharePoint S ...
- Java中static和final的区别
static是静态修饰关键字,可以修饰变量和程序块以及类方法: 当定义一个static的变量的时候jvm会将将其分配在内存堆上,所有程序对它的引用都会指向这一个地址而不会重新分配内存: 当修饰一个程序 ...