You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Eric Velazquez <ev...@yahoo.com.mx> on 2009/01/12 17:49:23 UTC
NPE on SAAJOutEndingInterceptor
Hello.
I am writing a cxf client and trying to use a username/password secutiry so
i am adding the WSS4JOutInterceptor to the interceptors chain but on
execution it gives me a NullPointerException.
Relevant Stack :
Caused by: java.lang.NullPointerException
at org.apache.cxf.staxutils.StaxUtils.writeStartElement(StaxUtils.java:368)
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:325)
at org.apache.cxf.staxutils.StaxUtils.copy(StaxUtils.java:313)
at
org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:161)
at
org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor$SAAJOutEndingInterceptor.handleMessage(SAAJOutInterceptor.java:127)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:466)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:299)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:251)
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:75)
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
the code:
Map<String, Object> outProps = new HashMap<String, Object>();
outProps.put(WSHandlerConstants.ACTION,
WSHandlerConstants.USERNAME_TOKEN);
outProps.put(WSHandlerConstants.USER, usuarioPassword[0]);
outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
CallbackHandler callback = new CallbackHandler() {
public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException {
WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];
// set the password for our message.
pc.setPassword("ThePassword");
}
};
outProps.put(WSHandlerConstants.PW_CALLBACK_REF, callback);
WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
clientEndPoint.getOutInterceptors().add(wssOut);
respuesta = myWebService.ejecuta(abono);
Using: CXF 2.1.3 over Weblogic 10.3
I have seen this error reported but have not found any working solution.
Any help would be appreciated.
Thanks
--
View this message in context: http://www.nabble.com/NPE-on-SAAJOutEndingInterceptor-tp21418356p21418356.html
Sent from the cxf-user mailing list archive at Nabble.com.