风落速度 2011-09-09 11:00
浏览 258
已采纳

web service连接数据

各位大大 小弟刚刚接触web service 想给个服务器端连接数据库查出结果集送给客户端,客户端接收后能打印出来的例子。用JAVA写 谢谢~~~~

  • 写回答

3条回答

  • qq1988627 2011-09-09 15:28
    关注

    <?xml version="1.0" encoding="UTF-8"?>
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
    http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd">
    <!-- 引入XFire预配置信息 -->

    <!-- 定义访问的url-->















      <!-- 使用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> 
      <bean id ="HelloWorldService"  parent="baseWebService"> 
         <!--  业务服务bean  --> 
         <property name="serviceBean" ref="webService"/> 
         <!--  业务服务bean的窄接口类  --> 
         <property name ="serviceClass" value="byd.service.IBaseService"/> 
      </bean> 
    

      <servlet>    
         <servlet-name>xfire</servlet-name>    
         <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> 
      </servlet >    
      <servlet-mapping>  
         <servlet-name>xfire</servlet-name> 
         <url-pattern>*.ws</url-pattern> 
      </servlet-mapping> 
      <servlet> 
         <!--  配合Spring容器中XFire一起工作的Servlet --> 
         <servlet-name>xfireServlet</servlet-name> 
         <servlet-class>org.codehaus.xfire.spring.XFireSpringServlet</servlet-class> 
      </servlet> 
      <servlet-mapping> 
         <servlet-name>xfireServlet</servlet-name> 
         <!--  在这个URI下开放Web Service服务  --> 
         <url-pattern>/service/*</url-pattern> 
      </servlet-mapping> 
     <!--  end XFire 配置  --> 
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波
  • ¥15 针对曲面部件的制孔路径规划,大家有什么思路吗
  • ¥15 钢筋实图交点识别,机器视觉代码
  • ¥15 如何在Linux系统中,但是在window系统上idea里面可以正常运行?(相关搜索:jar包)
  • ¥50 400g qsfp 光模块iphy方案
  • ¥15 两块ADC0804用proteus仿真时,出现异常
  • ¥15 关于风控系统,如何去选择
  • ¥15 这款软件是什么?需要能满足我的需求
  • ¥15 SpringSecurityOauth2登陆前后request不一致