`
sanshi
  • 浏览: 82188 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论
阅读更多

 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")括号里是要实现的接口

分享到:
评论
3 楼 JackCoffee 2010-09-24  
      <!-- 调用的类 -->           
       <property name="targetObject">
           <ref bean="quartzJob"/>
        </property>            
      <!-- 调用类中的方法 --> 
      <property name="targetMethod">
      <value>executeJob</value>
      </property>

请问下楼主:在调用类中的方法时,其中的name就是我们要调用的方法吗?还是<value>executeJob</value>中的executeJob就是我们要调用的方法呢?



2 楼 luoxiaohui_java 2010-04-13  
不知所云!!
1 楼 dinguangx 2010-03-23  
哥啊,全是代码没个说明呢

相关推荐

    apache-cxf-3.0.4

    Apache CXF = Celtix + XFire,开始叫 Apache CeltiXfire,后来更名为 Apache CXF 了,以下简称为 CXF。CXF 继承了 Celtix 和 XFire 两大开源项目的精华,提供了对 JAX-WS 全面的支持,并且提供了多种 Binding 、...

    cxf-core-3.0.1-API文档-中文版.zip

    赠送jar包:cxf-core-3.0.1.jar; 赠送原API文档:cxf-core-3.0.1-javadoc.jar; 赠送源代码:cxf-core-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-core-3.0.1.pom; 包含翻译后的API文档:cxf-core-3.0.1-...

    cxf至少需要的jar包下载,集成Spring cxf jar下载

    cxf与spring集成 需要最少的jar如下: cxf-2.3.3.jar geronimo-annotation_1.0_spec-1.1.1.jar geronimo-jaxws_2.2_spec-1.0.jar geronimo-stax-api_1.0_spec-1.0.1.jar geronimo-ws-metadata_2.0_spec-1.1.3.jar ...

    CXF接口所有所需jar包

    CXF接口所有所需jar包 1.cxf-2.3.3.jar 2.geronimo-annotation_1.0_spec-1.1.1.jar 3.geronimo-jaxws_2.2_spec-1.0.jar 4.geronimo-stax-api_1.0_spec-1.0.1.jar 5.geronimo-ws-metadata_2.0_spec-1.1.3.jar 6...

    cxf-rt-frontend-simple-3.0.1-API文档-中文版.zip

    赠送jar包:cxf-rt-frontend-simple-3.0.1.jar; 赠送原API文档:cxf-rt-frontend-simple-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-frontend-simple-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-frontend-...

    ssm+cxf(基于Maven开发的ssm框架集成cxf发布web service服务)

    源码里面包含了了一个简单的插入功能,主要是为了测试mybatis是否连接上数据库的时候写的测试类,作为一个刚学java,被抓壮丁的写服务器端的妹子,我只想说,画了我3周...如题,基于maven项目的ssm框架和cxf框架的整合。

    cxf-rt-bindings-soap-3.0.1-API文档-中文版.zip

    赠送jar包:cxf-rt-bindings-soap-3.0.1.jar; 赠送原API文档:cxf-rt-bindings-soap-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-bindings-soap-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-bindings-soap-...

    cxf-3.1.5 和 cxf-3.3.13 JAVA7和JAVA8对应CXF资源

    JAVA7和JAVA8对应CXF资源 WebService CXF 用了一天时间找,官网打不开,国内要积分,下下来又永不了。最后终于搞到手,上传上来分享给大家。 jdk版本 CXF版本 java 9及以上 3.3.x java 8 3.x java 7 2.2x --- ...

    cxf-rt-transports-http-3.0.1-API文档-中文版.zip

    赠送jar包:cxf-rt-transports-http-3.0.1.jar; 赠送原API文档:cxf-rt-transports-http-3.0.1-javadoc.jar; 赠送源代码:cxf-rt-transports-http-3.0.1-sources.jar; 赠送Maven依赖信息文件:cxf-rt-transports-...

    Java cxf开发webservice,分别有客户端和服务端

    2.用cxf开发webservice 3.这个服务端和客户端的小demo 在服务端 对外开放接口服务,然后在客户端 调用服务端的方法, 实现客户端(一个javaweb项目)对服务端(javaweb项目)方法的调用, 实际上就是发送和接收消息...

    apache-cxf-3.3.5

    Apache CXF is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS. These services can speak a variety of protocols such ...

    cxf.xml,cxf-servlet.xml,cxf-extension-soap.xml

    &lt;import resource="classpath:META-INF/cxf/cxf.xml"/&gt; &lt;import resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/&gt; &lt;import resource="classpath:META-INF/cxf/cxf-servlet.xml"/&gt;

    cxf3.1.18.rar

    spring 4.2.0 集成的cxf3.1.18的jar包,cxf-core-3.1.18.jar、cxf-rt-bindings-soap-3.1.18.jar、cxf-rt-databinding-jaxb-3.1.18.jar、cxf-rt-frontend-jaxws-3.1.18.jar、cxf-rt-frontend-simple-3.1.18.jar、cxf-...

    ssh整合cxf(webservice)

    ssh框架整合cxf(webservice),ssh案例(增、删、改、查),发布webservice,客户端调用,该工程自带jar包,mysql连接池,自动建库、建表。 ①直接解压,导入ssh2cxf项目 ②用tomcat启动ssh2cxf项目 ③在浏览器输入...

    用cxf开发webservice

    Apache CXF是一个开源的Service框架,它实现了JCP与Web Service中一些重要标准。CXF简化了构造,集成,面向服务架构(SOA)业务组件与技术的灵活复用。在CXF中,Service使用WSDL标准定义并能够使用各种不同的消息格式...

    apache-cxf-2.7.7

    CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载 CXF下载

    cxf-2.5.2.jar

    好用的cxf.jar,Apache CXF = Celtix + XFire,开始叫 Apache CeltiXfire,后来更名为 Apache CXF 了,以下简称为 CXF。CXF 继承了 Celtix 和 XFire 两大开源项目的精华,提供了对 JAX-WS 全面的支持,并且提供了多种...

    apache-cxf-3.1.1

    CXF 包含了大量的功能特性,但是主要集中在以下几个方面: 支持 Web Services 标准:CXF 支持多种 Web Services 标准,包含 SOAP、Basic Profile、WS-Addressing、WS-Policy、WS-ReliableMessaging 和 WS-Security。...

    CXF WEBSERVICE入门,非常详细实用

    Apache CXF = Celtix + XFire,Apache CXF 的前身叫 Apache CeltiXfire,现在已经正式更名为 Apache CXF 了,以下简称为 CXF。CXF 继承了 Celtix 和 XFire 两大开源项目的精华,提供了对 JAX-WS 全面的支持,并且...

    Spring CXF Restful 实例

    Spring CXF Restful 实例

Global site tag (gtag.js) - Google Analytics