Hi Micheal,

You also need to instantiate a ServerFactoryBean (or your own server factory that
extends ServerFactoryBean) and start it:

ServerFactoryBean svrFactory = new ServerFactoryBean();
svrFactory.setBus(bus);   // set cxf default bus
svrFactory.setServiceFactory(YourServiceFactoryBean);
svrFactory.setAddress(address); svrFactory.setStart(true);
svrFactory.create();

Before start the server , replace  the DestinationFactory
and create ServletController like the CXFServlet does.

Regards

Jim


Michael Kleinhenz wrote:
Hi Jim,

mmh, I don't get it, sorry. I create a new ServiceFactoryBean, do the
configuration, but what to do then? I suppose I have to inject the new
ServiceFactoryBean somehow into cxf.

subclassing AbstractServiceFactoryBean. Then use your own
ServiceFactoryBean to create your Servlet :

How do I do that? Sorry if this is a dull question, but I don't see how
the ServiceFactoryBean is used after creation:

public class MyCustomServlet extends CXFServlet
{
   @Override
   public void init(ServletConfig servletConfig)
                 throws ServletException
   {
       super.init(servletConfig);

       Bus bus = getBus();
       BusFactory.setDefaultBus(bus);

       YourServiceFactoryBean serviceFactory =
                    new YourServiceFactoryBean ();
       serviceFactory.getServiceConfigurations()
                  .add(0, new AbstractServiceConfiguration()

... I think there is something missing here ...

           // standard JAX-WS service creation
       Endpoint.publish("/OtherService", new OtherServiceImpl());
   }
}

Thanks,
Michael

Reply via email to