1.web.xml的配置如下
<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>
<servlet>
<servlet-name>xfire</servlet-name>
<servlet-class>org.codehaus.xfire.spring.XFireSpringServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>xfire</servlet-name>
<url-pattern>/service/*</url-pattern>
</servlet-mapping>
2.spring.xml的配置如下
<!-- 引入xfire.xml-->
<import resource="classpath:org/codehaus/xfire/spring/xfire.xml"/>
<bean id="baseWebService" class="org.codehaus.xfire.spring.remoting.XFireExporter" lazy-init="false" abstract="true">
<property name="serviceFactory" ref="xfire.serviceFactory"></property>
<property name="xfire" ref="xfire"></property>
</bean>
<!-- 要发布成WebService的接口实现类-->
<bean id="userSW" class="webservice.impl.UserServiceImpl"></bean>
<bean id="userService" parent="baseWebService">
<property name="serviceBean" ref="userSW"></property>
<property name="serviceClass" value="webservice.UserService"></property>
</bean>
3.客户端调用代码如下
Service serviceModel = new ObjectServiceFactory().create(UserService.class);
UserService service = (UserService) new XFireProxyFactory().create(serviceModel,"http://localhost:8080/xfire-service/service/UserService");
分享到:
相关推荐
spring+xfire( 编写webservice完整配置+案例)
Spring+xFire实现webService
Spring+Hibernate+Xfire+发布WebService教程文档
Spring+xfire实现WebService
xfire+spring+webservice+client xfire+spring+webservice+client xfire+spring+webservice+client
xfire+spring+webservice xfire+spring+webservice xfire+spring+webservice xfire+spring+webservice
spring +xfire整合 1. xfire + spring 发布webservice 2. 利用 javascript 调用发布的webservice
一个webservice实例,有自定义对象,数组的传输
webservice+spring+xfire完整项目(包含jar包),只要导入myeclipse就可以直接使用,已经导入所需的所有jar包了
NULL 博文链接:https://simpledev.iteye.com/blog/402109
本例子使用XFire发布WebService+XFire调用WebService-示例
cxf 请求webService 方式 xml
基于spring+hibernate +xfire框架开发的webservice 项目
XFire中实现WS-Security完整编 Spring+xFire+wss4j配置Helloworld实例 完整说明文档 Myeclipse项目 服务端工程 客户端工程
xfire+spring开发webservice 很不错的文档
NULL 博文链接:https://jishiweili.iteye.com/blog/2087930
网上资料大多是只有spring+xfire 含有Hibernate的少 3.配置时候还遇到spring实现 客户端调用服务器端时候 注入失败 4.在服务器端向客户端做映射的时候失败 5.在服务器端获取非基本类转化问题
spring和xfire集成的时候修要的jar文件,spring需要的jar文件自己另行下载。.
spring-xfire编写webservice