简单记录一下 刚写的webservice simple demo 2

编程技术  /  houtizong 发布于 3年前   113
<!-- 引入XFire预配置信息 -->
<import resource="classpath:org/codehaus/xfire/spring/xfire.xml"/>

<!-- 使用XFire导出器 -->
<bean id="baseWebService" class="org.codehaus.xfire.spring.remoting.XFireExporter" lazy-init="false" abstract="true">
   <!-- 引用xfire.xml中定义的工厂 -->
   <property name="serviceFactory" ref="xfire.serviceFactory"/>
   <!-- 引用xfire.xml中的xfire实例 -->
   <property name="xfire" ref="xfire"/>
</bean>

<!-- 定义所有访问 WEB服务的url -->
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
   <property name="urlMap">
    <map>
     <entry key="/HelloWorldService.ws"><ref local="HelloWorldService"/></entry>
    </map>
   </property>
</bean>

<!-- HelloWorld WEB服务 -->
<bean id="HelloWorld" class="com.test.webservice.impl.SayHelloImpl"/>
<bean id="HelloWorldService" parent="baseWebService">
   <!-- 业务服务bean -->
   <property name="serviceBean" ref="HelloWorld"/>
   <!-- 业务服务bean的窄接口类 -->
   <property name="serviceClass" value="com.test.webservice.SayHello"/>
</bean>
到这里服务端的配置 就完成了。
4、配置 client.xml
<bean id="HelloWorldService" class="org.codehaus.xfire.spring.remoting.XFireClientFactoryBean">
   <property name="serviceClass"><value>com.test.webservice.SayHello</value></property>
   <property name="wsdlDocumentUrl"><value>http://10.108.108.106:9090/webservice/HelloWorldService.ws?wsdl</value></property>
   <!-- 在系统启动时,spring不立即查找远程的服务Bean,而在请求该服务时查找  -->
   <property name="lookupServiceOnStartup"><value>false</value></property>
</bean>
5.远程调用即可

以上均出自别人 博客 ,自己实现一下 再次感谢写博客的兄弟了 。

请勿发布不友善或者负能量的内容。与人为善,比聪明更重要!

留言需要登陆哦

技术博客集 - 网站简介:
前后端技术:
后端基于Hyperf2.1框架开发,前端使用Bootstrap可视化布局系统生成

网站主要作用:
1.编程技术分享及讨论交流,内置聊天系统;
2.测试交流框架问题,比如:Hyperf、Laravel、TP、beego;
3.本站数据是基于大数据采集等爬虫技术为基础助力分享知识,如有侵权请发邮件到站长邮箱,站长会尽快处理;
4.站长邮箱:[email protected];

      订阅博客周刊 去订阅

文章归档

文章标签

友情链接

Auther ·HouTiZong
侯体宗的博客
© 2020 zongscan.com
版权所有ICP证 : 粤ICP备20027696号
PHP交流群 也可以扫右边的二维码
侯体宗的博客