Thanks a lot, now it works like this: The service provided by the
CXFServlet in Tomcat is configured via Spring application context,
and the callback service is created by JaxWsServerFactoryBean.
----- myService.xml -----
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import
resource="classpath:META-INF/cxf/cxf-extension-jaxws.xml" />
<import
resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<jaxws:endpoint id="myServiceEndpoint"
implementorClass="MyServiceInterface"
implementor="#myServiceImpl"
address="/myService"/>
----- myService.xml -----
----- cxf-bus.xml -----
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import
resource="classpath:META-INF/cxf/cxf-extension-jaxws.xml" />
<import
resource="classpath:META-INF/cxf/cxf-extension-soap.xml"/>
<import
resource="classpath:META-INF/cxf/cxf-extension-http-jetty.xml" />
----- cxf-bus.xml -----
----- java snippet -----
Bus bus = new SpringBusFactory().createBus("cxf-bus.xml");
JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean();
factory.setBus(bus);
factory.setServiceClass(CallbackInterface.class);
factory.setServiceBean(callbackImpl);
factory.setAddress(callbackUrl);
Server server = factory.create();
----- java snippet -----
Thanks again,
Christian
-----Original Message-----
From: Daniel Kulp [mailto:[email protected]]
Sent: Wednesday, December 09, 2009 4:54 PM
I think the only way to accomplish this is to have a separate Bus for
the
client. In your web service impl, you would do something like:
Bus orig = BusFactory.getThreadDefaultBus();
Bus bus = SpringBusFactory.createBus(... client config file ...);
BusFactory.setThreadDefaultBus(bus);
... create and use your client .....
BusFactory.setThreadDefaultBus(orig);
The Bus for the client could be held onto as a variable or similar to
avoid
recreating each time.
Dan
On Wed December 9 2009 7:31:48 am [email protected] wrote:
> Hi,
>
> I have a web application that provides a web service running on a
> Tomcat.
> While executing a service request the application calls other web
> services asynchronously, providing a callback service on an embedded
> Jetty.
>
> As far as I understand, I can't include both the cxf-servlet.xml (for
> the CXFServlet in Tomcat) and cxf-extension-http-jetty.xml (for the
> callback service in Jetty) in my Spring configuration.
>
> How is it possible to make it work anyway?
>
> Thanks in advance,
>
> Christian
>
--
Daniel Kulp
[email protected]
http://www.dankulp.com/blog