首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

CXF应用程序开发 WS 调整Spring

2012-10-23 
CXF应用程序开发 WS整合Spring源代码下载在applicationContext.xml配置如下:?xml version1.0 encoding

CXF应用程序开发 WS 整合Spring

源代码下载

在applicationContext.xml配置如下:

<?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.xsd
?????????????????????? http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
???????
???? <!--
???? ??服务端定义
???? ??
???? ??访问路径如下:http://localhost:8080/cxf/services/helloService?wsdl
???? ??services:web.xml中配置的拦截路径
???? ??/helloService:为服务的上下文
?? ? -->??????????????
?<import resource="classpath:META-INF/cxf/cxf.xml"/>
?<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
?<import resource="classpath:META-INF/cxf/cxf-servlet.xml"/>

?<jaxws:endpoint id="helloWorld"
?? ???implementor="com.easyway.cxf.service.HelloServiceImpl"
?? ???address="/helloService" />
?? ???
?? ?<!--
?? ??? 客户端定义
?? ? -->
?<bean id="client"
?????? factory-method="create"/>
??? <!--
????? 客户端采用 采用jaxWS 方式
???? -->
?<bean id="clientFactory" value="com.easyway.cxf.service.HelloService"/>
??????????? <property name="address"
???????????? value="http://localhost:8080/cxf/services/helloService"/>
? </bean>
</beans>

?

?

web.xml配置如下:

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="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">?
??????????????? <welcome-file-list>
???????????????????????? <welcome-file>index.jsp</welcome-file>
??????????????? </welcome-file-list>
??????????????? <!--
??????????????? Spring配置
???????????????? -->
??????????????? <context-param>
????????????????????????? <param-name>contextConfigLocation</param-name>
????????????????????????? <param-value>classpath:applicationContext.xml</param-value>
???????????????? </context-param>
????????????? <listener>
????????????????????? <listener-class>
????????????????????????????? org.springframework.web.context.ContextLoaderListener
????????????????????? </listener-class>
????????????? </listener>
????????????? <!--
??????????????? CXF配置
???????????????? -->
????????????? <servlet>
???????????????????? <servlet-name>CXFServlet</servlet-name>
???????????????????? <servlet-class>
??????????????????????????? org.apache.cxf.transport.servlet.CXFServlet
???????????????????? </servlet-class>
???????????????????? <load-on-startup>1</load-on-startup>
?????????????? </servlet>
?????????????? <servlet-mapping>
????????????????????? <servlet-name>CXFServlet</servlet-name>
????????????????????? <url-pattern>/services/*</url-pattern>
?????????????? </servlet-mapping>
???????? </web-app>

?

?

<?xml version="1.0" encoding="UTF-8"?>
<classpath>
?<classpathentry kind="src" path="src"/>
?<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
?<classpathentry kind="con" path="melibrary.com.genuitec.eclipse.j2eedt.core.MYECLIPSE_JAVAEE_5_CONTAINER"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/FastInfoset-1.2.7.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/XmlSchema-1.4.5.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/abdera-core-0.4.0-incubating.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/abdera-extensions-json-0.4.0-incubating.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/abdera-extensions-main-0.4.0-incubating.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/abdera-i18n-0.4.0-incubating.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/abdera-parser-0.4.0-incubating.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/ant-1.6.5.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/antlr-2.7.7.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/aopalliance-1.0.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/asm-2.2.3.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/axiom-api-1.2.7.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/axiom-impl-1.2.7.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/bcprov-jdk15-1.43.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-codec-1.3.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-collections-3.2.1.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-httpclient-3.1.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-lang-2.4.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-logging-1.1.1.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/commons-pool-1.5.2.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/cxf-2.1.9.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/cxf-manifest.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/geronimo-activation_1.1_spec-1.0.2.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/geronimo-annotation_1.0_spec-1.1.1.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/geronimo-javamail_1.4_spec-1.3.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/geronimo-jaxws_2.1_spec-1.0.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/geronimo-jms_1.1_spec-1.1.1.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/geronimo-servlet_2.5_spec-1.2.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/geronimo-stax-api_1.0_spec-1.0.1.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/geronimo-ws-metadata_2.0_spec-1.1.2.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jaxb-api-2.1.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jaxb-impl-2.1.9.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jaxb-xjc-2.1.9.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jaxen-1.1.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jdom-1.0.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jettison-1.1.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jetty-6.1.21.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jetty-util-6.1.21.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jra-1.0-alpha-4.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/js-1.6R7.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/jsr311-api-0.8.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/neethi-2.0.4.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/oro-2.0.8.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/saaj-api-1.3.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/saaj-impl-1.3.2.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/serializer-2.7.1.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/slf4j-api-1.5.8.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/slf4j-jdk14-1.5.8.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/spring-beans-2.0.8.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/spring-context-2.0.8.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/spring-core-2.0.8.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/spring-dao-2.0.8.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/spring-jms-2.0.8.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/spring-support-2.0.8.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/spring-web-2.0.8.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/velocity-1.6.2.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/wsdl4j-1.6.2.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/wss4j-1.5.8.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/wstx-asl-3.2.9.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/xalan-2.7.1.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/xml-resolver-1.2.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/xmlbeans-2.4.0.jar"/>
?<classpathentry kind="lib" path="WebRoot/WEB-INF/lib/xmlsec-1.4.3.jar"/>
?<classpathentry kind="output" path="WebRoot/WEB-INF/classes"/>
</classpath>

?

热点排行