背景:
阅读新闻
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
">
<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="
://www.springframework.org/schema/beans/spring-beans-2.5.xsd
://cxf.apache.org/schemas/jaxws.xsd
://cxf.apache.org/schemas/core.xsd
://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集成Quartz定时任务框架介绍和Cron表达式详解
Spring的Quartz定时器同一时刻重复执行二次的问题解决
相关资讯 Spring Spring整合CXF
本文评论 查看全部评论 (0)
尊重网上道德,遵守中华人民共和国的各项有关法律法规 承担一切因您的行为而直接或间接导致的民事或刑事法律责任 本站管理人员有权保留或删除其管辖留言中的任意内容 本站有权在网站内转载或引用您的评论 参与本评论即表明您已经阅读并接受上述条款
评论声明
最新资讯