cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: [Cxf-Interceptor] @InInterceptor/@OutInterceptor annotations ignored (JBoss 5.1.0, not 6 or 7)
Date Tue, 12 Aug 2014 13:27:54 GMT

You would need to ask about this on the JBoss lists.   They have their own class loaders and
integration things and such that can dictate some of the behavior around this. 

Dan



On Aug 11, 2014, at 3:18 PM, Aida <ai.desu@gmail.com> wrote:

> Hi all,
> 
> I have been googling and reading threads of this forum in order to solve
> this ...
> 
> I'm working with JBoss 5.1.0 GA, and I have EJBs as services (EJB 3.0). I'm
> trying to use the @InInterceptor and @OutInterceptor annotations in order to
> add a WSS4J interceptor (I want to sign and encrypt my messages).
> 
> I have read that in further versions of JBoss (as 6.X or 7.X) the
> annotations are ignored as is commented in [1]. In [2] says that a
> Dependency is needed in a Manifest file, but this is for JBoss AS 7 (not my
> version, anyway adding the Manifest as specified doesn´t works).
> 
> I have checked that when I call to my web-service, the interceptor that I
> add with the annotation isn´t called. I have also tried with other CXF
> Interceptors (ReadHeadersInterceptor), but no interceptor (set by me) is
> fired.
> 
> This is my service (I'm working with a proof of concept, but I'm not able to
> make it work):
> 
> @InInterceptors(interceptors =
> {"mypackage.WSSWithCertificateInInterceptor"})
> @WebService( name = "HelloWorldService", 
> 			 serviceName = "HelloWorldService",
> 			 targetNamespace = "http://mydomain/service/samples/")
> @Stateless(name = "HelloWorldService")
> @BindingType(value = SOAPBinding.SOAP12HTTP_BINDING)
> public class HelloWorldServiceImpl {
> 
> 	private static String HELLO_WORLD_MESSAGE = "Hello world {0}";
> 	
> 	/**
> 	 * Hello World Operation 
> 	 */
> 	@WebMethod
> 	public String helloWorld(@WebParam(name = "name") String name){
> 		
> 		return MessageFormat.format(HELLO_WORLD_MESSAGE, name);
> 	}
> }
> 
> 
> Where WSSWithCertificateInInterceptor is just an extension of
> WSS4JInInterceptor:
> 
> public class WSSWithCertificateInInterceptor extends WSS4JInInterceptor{
> 	
> 	private static Map<String,Object> inProps= new HashMap<String,Object>()
{
> 										/** generated UUID */
> 										private static final long serialVersionUID =
> -7905172475428802888L;
> 								
> 										{ 
> 											put(WSHandlerConstants.ACTION, WSHandlerConstants.SIGNATURE);
> 											put(WSHandlerConstants.SIG_PROP_FILE, "server_sign.properties");
> 										}
> 									};									
> 	
> 	public WSSWithCertificateInInterceptor () {
> 		super(inProps);
> 	}
> 
> }
> 
> (I know this isn´t maybe the best way ... but with the annotations I didn´t
> know how to set the props and I preferred to make the important work first).
> 
> 
> If anyone could help (or give a clue about why the interceptors are not
> firing) I would be thankful.
> 
> Thanks in advance.
> 
> KR,
> 
>  Aida
> 
> 
> [1]
> http://cxf.547215.n5.nabble.com/CXF-WSS4J-Interceptors-not-working-td5727229.html#a5727488
> [2] https://docs.jboss.org/author/display/JBWS/JBoss+Modules
> 
> 
> 
> 
> 
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Cxf-Interceptor-InInterceptor-OutInterceptor-annotations-ignored-JBoss-5-1-0-not-6-or-7-tp5747625.html
> Sent from the cxf-user mailing list archive at Nabble.com.

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Mime
View raw message