On Monday 29 November 2010 5:28:37 pm Juan Pablo Pizarro wrote:
> Hello, I'm trying to call a web service that uses certificates (
> http://wss.aduanas.gub.uy/LuciaWsSecurity/Stock.svc?wsdl). Can you guys
> send me a tutorial to do that?

We don't have access to that WSDL.   


> In this project I can not use spring (I saw some tutorials using spring).
> Exists a tutorial using only cxf to do that?

It depends.   If the WSDL contains WS-SecurityPolicy assertions, the easiest 
thing to do is let the WS-SecurityPolicy runtime just handle everything.   
You'll just need to configure in the crypto stuff.   Some (very little) docs 
are at:
http://cxf.apache.org/docs/ws-securitypolicy.html

If it doesn't contain the SecPolicy things, then you would need to configure 
the WSS4J*Interceptors directly as below.

Dan



> 
> 
> From CXF site (http://cxf.apache.org/docs/ws-security.html), I saw that we
> can put interceptors to do that:
> 
> import org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor;
> import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor;
> ...
> 
> Map<String,Object> inProps= new HashMap<String,Object>();
> ... // how to configure the properties is outlined below;
> 
> WSS4JInInterceptor wssIn = new WSS4JInInterceptor(inProps);
> cxfEndpoint.getInInterceptors().add(wssIn);
> cxfEndpoint.getInInterceptors().add(new SAAJInInterceptor()); // 2.0.x
> only; not needed in 2.1+
> 
> Map<String,Object> outProps = new HashMap<String,Object>();
> ... // how to configure the properties is outlined below;
> 
> WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
> cxfEndpoint.getOutInterceptors().add(wssOut);
> cxfEndpoint.getOutInterceptors().add(new SAAJOutInterceptor());
> 
> 
> But I can not find the method to get the cxfEndpoint from my classes. I'm
> using snapshot 2.4.
> 
> Thanks!

-- 
Daniel Kulp
[email protected]
http://dankulp.com/blog

Reply via email to