CXF之jaxws:endpoint对spring bean的引用

来源:互联网 发布:win7下nginx配置php 编辑:程序博客网 时间:2024/06/07 13:01

由于CXF对spring的无缝支持,CXF的使用,经常与spring捆绑在一起。随之而起的,自然是想在jaxws:endpoint中引用spring bean。在CXF提供的HelloWorld例子中,配置如下:
<jaxws:endpoint id="helloWorld" implementor="demo.spring.HelloWorldImpl" address="/HelloWorld" />
这里,其实现方式就没法再引用其它的spring bean了。若想引用spring bean,方式有两种:

方式一:
<bean name = "implementorBean" *** />
<jaxws:endpoint id="helloWorld" 
                implementor="#implementorBean"
                address="/HelloWorld" />

方式二:
<jaxws:endpoint id="theImplementor"
                implementorClass="demo.spring.HelloWorld"
                address="
http://localhost:8080/simpleWithAddress">
       <jaxws:implementor>
          <bean ref="implementorBean"/>
       </jaxws:implementor>
 </jaxws:endpoint>

阅读全文
0 0