Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache CXF Spring Java Config for JAXWS Endpoint

Tags:

spring

cxf

I'm trying to configure Spring with Apache CXF using java config (no XML config) and wanted to know how to register JAXWS endpoints using spring java config. For example, what would be the 'java config' equivalent for the XML config below?

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

Kind regards, Zahanghir

like image 304
Zahanghir Avatar asked Oct 22 '25 06:10

Zahanghir


1 Answers

The 'Java-config' equivalent of your XML configuration is something like :

@Configuration
public class CXFConfiguration {

   @Autowired
   private ReportService reportServ;

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

}

I hope this can help you ^^.

like image 92
KevinHol Avatar answered Oct 24 '25 00:10

KevinHol