I have published a Web-Service in Tomcat with cxf-servlet.xml

   <jaxws:endpoint id="myService"
        implementor="#MyServiceImpl" address="/MyService">
   </jaxws:endpoint>

So far, so god.

Now I wanted to add a CXF ServerLifeCycleListener, but it seems this has to
be done BEFORE the service is published in order to have an effect.

How can I do this with Tomcat / Spring?


When I run my app in pure Java I do it this way:

        Bus cxfBus = BusFactory.getDefaultBus();
        ServerLifeCycleManager mgr =
cxfBus.getExtension(ServerLifeCycleManager.class);
        mgr.registerListener(new MyListener());

        MyServiceImpl fri = new MyServiceImpl();
        Endpoint ep = Endpoint.publish("http://localhost:8080/apps/MyService";,
service);

This works.

- But how do I get access to the *correct* bus when deployed in Tomcat?
- And how can I set my ServerLicefycleListener *before* services get
published by the cxf-servlet.xml?

Reply via email to