cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From matteo <>
Subject CXF Interceptors problem in OSGi
Date Tue, 07 Sep 2010 10:29:17 GMT

Dear all,
Let me briefly introduce my environment:
	OSGi exec environment - equinox implementation, version
	Apache CXF  		  - version 2.2.10

I'm trying to enable CXF interceptors to address security issues in my web
services but I cannot get these in/out interceptors be called. Here are some
details of the problem:

I have a bundle called CXFBundle where I stashed all the modules and
libraries that come with the CXF 2.2.10 binary distribution and a bundle
called BundleCXFServer where I publish my endpoint with

	IPersistence pers = PersistenceFactory.getPersist(); // returns the
IPersistence implementation
	String addr = "http://myServerIP:8160/Persistence"; ep = org.apache.cxf.jaxws.EndpointImpl.publish(addr,

The IPersistence interface is declared inside a osgi service called
DataTypeService and the IPersistence implementation (the
dbproxyservice.PersistenceHandler class) is defined within a bundle called

@WebService(targetNamespace = "http://dbproxyservice/")
public interface IPersistence {
	 * Clean the database.
	 * @param list
	public void CleanDb();

			endpointInterface= "datatype.IPersistence",
@InInterceptors (interceptors =
public class PersistenceHandler implements IPersistence {
	public void CleanDb(){
		// do actions...

and in the bundle DBProxyService I also put the WSSecurityInterceptor class:

public class WSSecurityInterceptor extends AbstractSoapInterceptor{
	public WSSecurityInterceptor() {     

	public WSSecurityInterceptor(String s) {

	public void handleMessage(SoapMessage message) throws Fault {
		Map props = new HashMap();
		props.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
		props.put(WSHandlerConstants.PW_CALLBACK_REF, new PasswordHandler());
		WSS4JInInterceptor wss4jInHandler = new WSS4JInInterceptor(props);
		ValidateUserTokenInterceptor userTokenInterceptor = new
		message.getInterceptorChain().add(new SAAJInInterceptor());

If I put a breakpoint in the first line of my handleMessage method it never
gets hit. And the interesting fact is that the CleanDb() service works
perfectly when the client invokes it even if I don't specify any client-side
interceptor and no exception is thrown (both client-side and server-side).
I cannot understand if this is a CXF-OSGi interoperability problem or just a
silly error of mine in the procedure that I reported above.

Thank you very much,

View this message in context:
Sent from the cxf-user mailing list archive at

View raw message