XFire 1.2.6
从官方网
上下载xfire-distribution-1.2.6.zip,下载到本地解压后可以得到XFire编译打包后的文件xfire-all-1.2.6.jar,lib目录下为XFire所依赖的第三方Jar文件,在开发的时候用得到,此外还包括手册和几个例子。建议在Eclipse里建一个用户库,把
xfire-all-1.2.6.jar和XFire所依赖的第三方Jar文件都包含进去。
建立一个Tomcat工程,名叫XFireSpring。--用里面spring的例子
WEB-INF文件夹下web.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<!-- START SNIPPET: xfire -->
<!--xfire使用 classpath:org/codehaus/xfire/spring/xfire.xml-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
<!--classpath:org/codehaus/xfire/spring/xfire.xml -->
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- 配合Spring容器中XFire一起工作的Servlet-->
<servlet>
<servlet-name>xfire</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>xfire</servlet-name>
<url-pattern>/services/*</url-pattern><!-- 在这个URI下开放Web Service服务 -->
</servlet-mapping>
<!-- END SNIPPET: xfire -->
</web-app>
WEB-INF文件夹下xfire-servlet.xml
:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
<beans>
<!-- 引入XFire预配置信息 -->
<import resource="classpath:org/codehaus/xfire/spring/xfire.xml"/>
<!-- START SNIPPET: xfire -->
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<entry key="/EchoService"><!-- 访问路径http://127.0.0.1:8080/XFireSpring/services/EchoService?wsdl -->
<ref bean="echo"/>
</entry>
</map>
</property>
</bean>
<!-- Declare a parent bean with all properties common to both services -->
<bean id="echo" class="org.codehaus.xfire.spring.remoting.XFireExporter">
<!-- 引用xfire.xml中定义的工厂 -->
<property name="serviceFactory">
<ref bean="xfire.serviceFactory"/>
</property>
<!-- 引用xfire.xml中的xfire实例 -->
<property name="xfire">
<ref bean="xfire"/>
</property>
<property name="serviceBean">
<ref bean="echoBean"/>
</property>
<property name="serviceClass">
<value>org.codehaus.xfire.spring.example.Echo</value>
</property>
</bean>
<bean id="echoBean" class="org.codehaus.xfire.spring.example.EchoImpl"/>
<!-- END SNIPPET: xfire -->
</beans>
具体详看附件
。
http://127.0.0.1:8080/
XFireSpring/services/EchoService?wsdl
分享到:
相关推荐
spring与xfire整合正确演示例子
xFire与Spring集成xFire与Spring集成xFire与Spring集成xFire与Spring集成xFire与Spring集成
xfire spring例子
自己写给同事培训的xfire整合spring的小项目 步骤清晰 简单易懂 适合刚刚接触xfire的同事们
xfire+spring+webservice+client xfire+spring+webservice+client xfire+spring+webservice+client
xfire+spring+安全认证,包含服务端和客户端,xfire jar包可以从我的资源下面下或网上很多。
XFire与Spring组合发布webservices的几种方式实例,可以直接导入到环境运行
xfire-spring,学习WebService,Xfire和Spring集成的好资料。
xfire+spring开发webservice 很不错的文档
xfire跟spring和hibernate集成例子
webservice中用到的jar,xfire-spring-1.2.6.jar,xfire-spring-1.2.6.jar,xfire-spring-1.2.6.jar,xfire-spring-1.2.6.jar
xfire集成了spring的jar包,放到工程中引用即可用xfire集成spring的方式进行webservice接口开发
XFire 是与Axis 2并列的新一代Web Service框架,通过提供简单的API支持Web Service各项标准协议,帮助你方便快速地开发Web Service应用。 相对于Axis来说,目前XFire相对受欢迎,加上其提供了和Spring集成的支持,在...
xfire与 spring整合框架。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
使用xfire+spring编写webservice例子,供大家学习与交流,是一个完整的实例,里面有说明文档
xfire+Spring整合发布webservice,详细解释配置过程,及是替代码,帮助一部分需要这方面开发的人员。
xfire-spring-1.2.6.jar
Xfire1.2.6和Spring2整合 访问时提供了三种不同的方法
使用XFire+Spring构建Web Service。自己参考网上的讲解写的例子。里面有help.txt 介绍了我参考的xfire+spring集成的网址。
使用XFire+Spring构建Web Service步骤以及源代码.rar