XFire开发Web Service

2 篇文章 0 订阅
1 篇文章 0 订阅

XFire的部分配置:(原创额!眨眼)

 

<!-- XFire 配置Start -->
 
 <bean id="namingTransactionAttribute"
  class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource">
  <property name="properties">
   <props>
    <prop key="insert*">PROPAGATION_REQUIRED</prop>
    <prop key="create*">PROPAGATION_REQUIRED</prop>
    <prop key="update*">PROPAGATION_REQUIRED</prop>
    <prop key="save*">PROPAGATION_REQUIRED</prop>
    <prop key="del*">PROPAGATION_REQUIRED</prop>
    <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
   </props>
  </property>
 </bean>
 
 <bean id="baseTransactionProxy"
  class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
  abstract="true">
  <property name="transactionManager" ref="transactionManager" />
  <property name="transactionAttributeSource">
   <ref bean="namingTransactionAttribute" />
  </property>
 </bean>
 <!--  高级查询Start -->
 <bean id="StatisticalQueryService" parent="baseWebService">
<!--   业务服务bean -->
  <property name="serviceBean" ref="baseServiceOfStatisticalQueryService" />
<!--   业务服务bean的窄接口类 -->
  <property name="serviceClass" value="com.hjdf.cnmsa.law.service.StatisticalQueryService" />
 </bean>
 
 <bean id="baseServiceOfStatisticalQueryService" parent="baseTransactionProxy">
  <property name="proxyInterfaces">
   <list>
    <value>com.hjdf.cnmsa.law.service.StatisticalQueryService</value>
   </list>
  </property>
  <property name="target">
   <ref bean="baseserviceTargetOfStatisticalQueryService" />
  </property>
 </bean>
 
<!-- StatisticalQueryDao 要区分 注解:@Repository(value = "statisticalQueryDao") 否则报NullPoint异常  -->
 <bean id="baseserviceTargetOfStatisticalQueryService" class="com.hjdf.cnmsa.law.service.impl.StatisticalQueryServiceImpl">
  <property name="StatisticalQueryDao">
   <ref bean="StatisticalQueryDao" />
  </property>
 </bean>
 
 <bean id="StatisticalQueryDao" class="com.hjdf.cnmsa.law.dao.impl.StatisticalQueryDaoImpl">
  <property name="sessionFactory">
   <ref bean="sessionFactory"></ref>
  </property>
 </bean>
 
 <import resource="classpath:org/codehaus/xfire/spring/xfire.xml" />
 <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
  <property name="urlMap">   
    <map>
     <entry key="/StatisticalQueryService.ws">
      <list>
       <ref bean="StatisticalQueryService" />
      </list>
     </entry>
    </map> 
  </property>
 </bean>
 
<!--  高级查询End -->
 
 <bean id="punishmentSnapshotDao" class="com.hjdf.cnmsa.law.dao.impl.PunishmentSnapshotDaoImpl">
  <property name="sessionFactory">
   <ref bean="sessionFactory"></ref>
  </property>
 </bean>
 
 <bean id="baseserviceTarget" class="com.hjdf.cnmsa.law.service.impl.PunishmentSnapshotServiceImpl">
  <property name="punishmentSnapshotDao">
   <ref bean="punishmentSnapshotDao" />
  </property>
 </bean>
 
 <bean id="baseService" parent="baseTransactionProxy">
  <property name="proxyInterfaces">
   <list>
    <value>com.hjdf.cnmsa.law.service.PunishmentSnapshotService</value>
   </list>
  </property>
  <property name="target">
   <ref bean="baseserviceTarget" />
  </property>
 </bean>
 
 <import resource="classpath:org/codehaus/xfire/spring/xfire.xml" />
 <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
  <property name="urlMap">   
    <map>
     <entry key="/PunishmentSnapshotService.ws">
      <list>
       <ref bean="PunishmentSnapshotService" />
      </list>
     </entry>
    </map> 
  </property>
 </bean>
 
 <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>

 <bean id="PunishmentSnapshotService" parent="baseWebService">
  <!-- 业务服务bean -->
  <property name="serviceBean" ref="baseService" />
  <!-- 业务服务bean的窄接口类 -->
  <property name="serviceClass" value="com.hjdf.cnmsa.law.service.PunishmentSnapshotService" />
 </bean>
 <!-- XFire 配置End -->

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值