2014-12-05 127 views
2

我正在嘗試使用java配置(無XML配置)配置Spring的Apache CXF,並想知道如何使用spring java config註冊JAXWS端點。例如,下面的XML配置的'java config'等效項是什麼?Apache CXF Spring JAXWS端點的Java配置

<jaxws:endpoint id="reportService" implementor="#reportServ" address="/reportService"/> 

親切的問候, Zahanghir

回答

3

XML配置的 'Java的配置' 相當於是一樣的東西:

@Configuration 
public class CXFConfiguration { 

    @Autowired 
    private ReportService reportServ; 

    @Bean 
    public Endpoint endpoint() { 
     Endpoint endpoint = new EndpointImpl(reportServ); 
     endpoint.publish("/reportService"); 
     return endpoint; 
    } 

} 

我希望這可以幫助你^^。