区别是:
- 只有对应的接口,没有Main函数了
- 在web.xml中设定一个名称,然后引入cfx相关的Servlet对应的类
- 定义一个Servlet,访问这个Servlet的时候,就会往其路径下走
定义一个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.