CXF

 CXF服务器端Spring配置文件:

       <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:jaxws="http://cxf.apache.org/jaxws"
 xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">

 <import resource="classpath:META-INF/cxf/cxf.xml" />
 <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" />
 <import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
 
   <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
  destroy-method="close" >
  <property name="driverClassName">
   <value>oracle.jdbc.driver.OracleDriver</value>
  </property>
  <property name="url">
   <value>jdbc:oracle:thin:@192.168.2.100:1521:orcl</value>
  </property>
  <property name="username">
   <value>sanshi</value>
  </property>
  <property name="password">
   <value>sanshi</value>
  </property>
  <property name="maxActive">
   <value>20</value>
  </property>
  <property name="maxIdle">
   <value>10</value>
  </property>
  <property name="maxWait">
   <value>-1</value>
  </property>
 </bean>
 
 
  
 <bean id="sessionFactory"
  class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  <property name="dataSource">
   <ref bean="dataSource" />
  </property>
  
  <property name="mappingLocations">
   <list>
    <value>classpath*:/com/hongxin/entity/*.hbm.xml</value>
 
   </list>
  </property>
  <property name="hibernateProperties">
   <props>
    <prop key="hibernate.dialect"> org.hibernate.dialect.Oracle10gDialect
 </prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.format_sql">true</prop>
    
    <prop key="hibernate.hbm2ddl.auto">update</prop>
    
    <prop key="hibernate.jdbc.fetch_size">50</prop>
   </props>
  </property>
 </bean>
 
 <bean id="transactionManager"
  class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  <property name="sessionFactory">
   <ref local="sessionFactory" />
  </property>
 </bean>
  <bean id="txProxyTemplate" abstract="true" lazy-init="true"
  class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
  <property name="transactionManager">
   <ref bean="transactionManager" />
  </property>
  <property name="transactionAttributes">
   <props>
    <prop key="save*">PROPAGATION_REQUIRED</prop>
    <prop key="remove*">PROPAGATION_REQUIRED</prop>
    <prop key="delete*">PROPAGATION_REQUIRED</prop>
    <prop key="*">PROPAGATION_REQUIRED</prop>
   </props>
  </property>
 </bean>
 
     <bean id="userAccountDaoInterface" class="com.hongxin.userAccount.UserAccountDaoInterfaceImpl">
     <property name="sessionFactory">
       <ref bean="sessionFactory"/>
      </property>
    </bean>
    <bean id="accountDaoInterface" class="com.hongxin.account.AccountDaoInterfaceImpl" autowire="byName">
      <property name="sessionFactory">
       <ref bean="sessionFactory"/>
      </property>
    </bean>
    <bean id="sendMessageDaoInterface" class="com.hongxin.sendMessage.SendMessageDaoInterfaceImpl">
      <property name="sessionFactory">
       <ref bean="sessionFactory"/>
      </property>
    </bean>
    <bean id="sxtClient" class="com.hongxin.sendMessage.SXTClient" autowire="byName">
     <property name="accountDaoInterface">
      <ref bean="accountDaoInterface"/>
     </property>
    </bean>
    <bean id="receiveMessageDaoInterface" class="com.hongxin.receiveMessage.ReceiveMessageDaoInterfaceImpl">
      <property name="sessionFactory">
       <ref bean="sessionFactory"/>
      </property>
    </bean>
    <bean id="sendMessageInterface" class="com.hongxin.sendMessage.SendMessageInterfaceImpl" autowire="byName">
    </bean>
    <bean id="receiveShortMessageService" class="com.hongxin.receiveMessageQuartzJob.ReceiveShortMessageServiceImpl" autowire="byName"/>
    <bean id="quartzJob" class="com.hongxin.receiveMessageQuartzJob.ReceiveShortMessageQuartzJob" autowire="byName"/>
  
    <jaxws:endpoint id="accountService"
  implementor="#accountDaoInterface" address="/accountServices">
 </jaxws:endpoint>
    <jaxws:endpoint id="receiveMessage"
  implementor="#receiveMessageDaoInterface" address="/receiveMessage">
 </jaxws:endpoint>
 <jaxws:endpoint id="querySendMessage"
  implementor="#sendMessageDaoInterface" address="/querySendMessage">
 </jaxws:endpoint>
 <jaxws:endpoint id="sendMessage"
  implementor="#sendMessageInterface" address="/sendMessage">
 </jaxws:endpoint>
 <jaxws:endpoint id="userAccount"
     implementor="#userAccountDaoInterface" address="/userAccount">
 </jaxws:endpoint>
    <bean id="jobtask" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
      <!-- 调用的类 -->           
       <property name="targetObject">
           <ref bean="quartzJob"/>
        </property>            
      <!-- 调用类中的方法 --> 
      <property name="targetMethod">
      <value>executeJob</value>
      </property>
    </bean> 
    <!-- 定义触发时间 -->
    <bean id="doTime" class="org.springframework.scheduling.quartz.CronTriggerBean">
    <property name="jobDetail">
    <ref bean="jobtask"/>
    </property>
     <!-- cron表达式 -->
     <property name="cronExpression">
       <value>0 */4 * * * ?</value>
    </property>
    </bean>   
     <!-- 总管理类 如果将lazy-init='false'那么容器启动就会执行调度程序  -->
     <bean id="startQuertz" lazy-init="false" autowire="no" class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
       <property name="triggers">
          <list>
            <ref bean="doTime"/>
          </list>
       </property>
     </bean>  
</beans>

 

web.xml配置文件:

   <?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
 xmlns="http://java.sun.com/xml/ns/javaee"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
 <context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>
   classpath:applicationContext.xml   
  </param-value>
 </context-param>
 <servlet>
  <servlet-name>CXFServlet</servlet-name>
  <servlet-class>
   org.apache.cxf.transport.servlet.CXFServlet
  </servlet-class>
  <load-on-startup>2</load-on-startup>
 </servlet>
 <servlet-mapping>
  <servlet-name>CXFServlet</servlet-name>
  <url-pattern>/services/*</url-pattern>
 </servlet-mapping>
 <listener>
  <listener-class>
   org.springframework.web.context.ContextLoaderListener</listener-class>
 </listener>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>
在接口上注明@WebService

在实现类上注明:@WebService(endpointInterface = "com.hongxin.receiveMessage.ReceiveMessageDaoInterface")括号里是要实现的接口

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值