RSS
热门关键字:  java  Ajax  JSP  JSF  Struts
当前位置 : 首页>Spring>列表

webservice-之使用xfire+spring开发

来源:勇哥的BLOG 作者: 时间:2008-03-03 点击:

    <bean       class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">

        <property name="urlMap">

            <map>

                <entry key="/myHelloService.ws"><!-- 暴露的服务名称 -->

                    <ref bean="myTest" />

                </entry>

            </map>

        </property>

    </bean>

    <bean id="myTest" parent="webService"

        class="org.codehaus.xfire.spring.remoting.XFireExporter">

        <!-- 定义实现类(指向applicationContext-webService.xml) -->

        <property name="serviceBean">

            <ref bean="myHelloBean" />

        </property>

        <!-- 定义接口类 -->

        <property name="serviceClass">

            <value>test.HelloRemote</value>

        </property>

    </bean>

    <!-- webService 基本配置 -->

    <bean id="webService"

        class="org.codehaus.xfire.spring.remoting.XFireExporter"

        abstract="true">

        <property name="serviceFactory">

            <ref bean="xfire.serviceFactory" />

        </property>

        <property name="xfire">

            <ref bean="xfire" />

        </property>

    </bean>

</beans>

----------------------------------------------

spring 的配置文件 applicationContext-webService.xml

<?xml version="1.0" encoding="UTF-8"?>  

<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"

"http://www.springframework.org/dtd/spring-beans.dtd">    

<beans>  

    <bean id="myHelloBean" class="test.HelloBean"></bean>  

</beans>

共3页: 上一页 [1] [2] 3 下一页
最新评论共有 0 位网友发表了评论
发表评论
评论内容:不能超过250字,需审核,请自觉遵守互联网相关政策法规。
用户名: 密码:
匿名?
注册
Google Adsense
相关文章