`
no7beckham
  • 浏览: 94792 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

cxf学习记录

    博客分类:
  • JAVA
阅读更多
今天看了一个ibm的cxf教学文章,同时看了samples里面例子,对pojo的方式不太明白,在je里查了之后才知道cxf支持两种服务实现 POJO和JSR181标记过(Annoatated)的Java类,同时在cxf-servlet.xml里面的配置也略有不同
<beans xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd">
<jaxws:server id="jaxwsService" serviceClass="demo.hw.server.HelloWorld" address="/hello_world">
    <jaxws:serviceBean>
    <bean class="demo.hw.server.HelloWorldImpl"/>
    </jaxws:serviceBean>
</jaxws:server>
</beans>

<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:simple="http://cxf.apache.org/simple"
      xmlns:soap="http://cxf.apache.org/bindings/soap"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/bindings/soap http://cxf.apache.org/schemas/configuration/soap.xsd http://cxf.apache.org/simple http://cxf.apache.org/schemas/simple.xsd">
  <simple:server id="pojoservice" serviceClass="demo.hw.server.HelloWorld" address="/hello_world">
  	<simple:serviceBean>
  		<bean class="demo.hw.server.HelloWorldImpl" />
  	</simple:serviceBean>
  </simple:server>
</beans>

其中annotation的方式更灵活一些,但是pojo的方式简单,容易理解一些,各有千秋啊!
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics