手机版
你好,游客 登录 注册
背景:
阅读新闻

Spring CXF 整合 发布WebService

[日期:2013-10-21] 来源:Linux社区  作者:375163948 [字体:大 中 小]

web.xml引入CXF和Spring
<?xmlversion="1.0"encoding="UTF-8"?>
<web-appversion="2.5"
xmlns="http://Java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:/cxf-servlet.xml</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>CXFServlet</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>CXFServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
</web-app>

cxf-servlet.xml
<?xmlversion="1.0"encoding="UTF-8"?>
<beansxmlns="http://www.springframework.org/schema/beans"
xmlns:cxf="http://cxf.apache.org/core"
xmlns:jaxws="http://cxf.apache.org/jaxws"
xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-2.5.xsd
http://cxf.apache.org/jaxwshttp://cxf.apache.org/schemas/jaxws.xsd
http://cxf.apache.org/corehttp://cxf.apache.org/schemas/core.xsd
http://cxf.apache.org/transports/http/configurationhttp://cxf.apache.org/schemas/configuration/http-conf.xsd">
<importresource="classpath:META-INF/cxf/cxf.xml"/>
<importresource="classpath:META-INF/cxf/cxf-servlet.xml"/>
<importresource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
<importresource="classpath:/cxf-in.xml"/>
<cxf:bus>
<cxf:inInterceptors>
<beanclass="cxfserver.WsdSoapInInterceptor"/>
</cxf:inInterceptors>
</cxf:bus>
<cxf:bus>
<cxf:inInterceptors>
<beanclass="zkg.SoapInInterceptor"/>
</cxf:inInterceptors>
</cxf:bus>
<beanid="hello"class="cxfserver.HelloWorldImpl"/>
<jaxws:endpointid="helloWorld"implementor="#hello"address="/HelloWorld">
<jaxws:inInterceptors>
<!--<beanclass="cxfserver.WsdSoapInInterceptor"></bean>
<beanclass="zkg.SoapInInterceptor"/>-->
</jaxws:inInterceptors>
</jaxws:endpoint>
</beans>

相关阅读:

运用Spring注解实现Netty服务器端UDP应用程序 http://www.linuxidc.com/Linux/2013-09/89780.htm

Spring2.5.6+Hibernate3+RMI整合 http://www.linuxidc.com/Linux/2013-08/89161.htm

Struts2与Spring整合步骤 http://www.linuxidc.com/Linux/2013-08/88248.htm

Spring集成Quartz定时任务框架介绍和Cron表达式详解 http://www.linuxidc.com/Linux/2013-03/81947.htm

Spring整合Quartz http://www.linuxidc.com/Linux/2012-12/75284.htm

Spring的Quartz定时器同一时刻重复执行二次的问题解决 http://www.linuxidc.com/Linux/2012-11/73443.htm

Spring 定时器Quartz的用法 http://www.linuxidc.com/Linux/2012-11/73442.htm

Spring联姻Quartz实现作业调度 http://www.linuxidc.com/Linux/2012-08/69215.htm

linux
相关资讯       Spring  Spring整合CXF 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款