Despite I have set the username, password, action, and WS Security Password Type (which is PasswordText), getting this exception when I try to call a service of the web service: No security action was defined. The web service I try to communicate uses Basic Authentication with using PasswordText WS Security Password Type.
Here is what I have tried:
Map<String, Object> ctx = ((BindingProvider) basicHttpBindingIDeneme).getRequestContext();
ctx.put("ws-security.username", USERNAME);
ctx.put("ws-security.password", PASSWORD);
Map<String,Object> inProps = new HashMap<String,Object>();
inProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
inProps.put(WSHandlerConstants.ACTION, "UsernameToken");
WSS4JInInterceptor wssIn = new WSS4JInInterceptor(inProps);
org.apache.cxf.endpoint.Client client = ClientProxy.getClient(basicHttpBindingIDeneme);
org.apache.cxf.endpoint.Endpoint cxfEndpoint = client.getEndpoint();
cxfEndpoint.getInInterceptors().add(wssIn);
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);
What else do I need to configure in order to define security action?
p.s. Using Apache CXF 3.1.12 which is the latest version available.
Did you add the security interceptor to bean.xml?