Spring整合cfx

本文介绍了如何在Spring框架中整合CXF服务,包括在web.xml中配置服务名称,引入CXF Servlet,以及定义Servlet来处理请求。同时,还提到了Spring配置文件在整合过程中的作用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

区别是:

  1. 只有对应的接口,没有Main函数了
  2. 在web.xml中设定一个名称,然后引入cfx相关的Servlet对应的类
  3. 定义一个Servlet,访问这个Servlet的时候,就会往其路径下走
  4. 定义一个Spring配置文件

    1.  声明
    
                1. xmlns:jaxws="http://cxf.apache.org/jaxws"//soap风格要引的包
                    xmlns:jaxrs="http://cxf.apache.org/jaxrs"//restful风格
                2.  http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd 
                    http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd 
    2. <import resource="classpath:META-INF/cxf/cxf.xml" />
    
                    <jaxws:endpoint id="helloworld" implementor="com.atguigu.cxf.spring.HelloWorldImpl" address="/HelloWorld">//implementor实现类全路径,定义address相对地址
                    </jaxws:endpoint>
    
                    <jaxrs:server id="customerService" address="/CustService">
                        <jaxrs:serviceBeans>
                            <bean class="com.atguigu.service.CustomerService"/>
                        </jaxrs:serviceBeans>
                    </jaxrs:server>
    
     2. 
    
  5. 例子
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值