Hello,

I would like to replace the following code

--
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
                
Client client = 
dcf.createClient("http://0.0.0.0:8480/sendNewLokalMessage/?wsdl";);
                
Map<String, Object> outProps = new HashMap<String, Object>();
outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
outProps.put(WSHandlerConstants.USER, "someuser");
outProps.put(WSHandlerConstants.PW_CALLBACK_REF, new CallbackHandler() {
public void handle(Callback[] callbacks) {
        WSPasswordCallback callback = (WSPasswordCallback) callbacks[0];
        callback.setPassword("somePw");                         
        }
});
                
client.getOutInterceptors().add(new WSS4JOutInterceptor(outProps));
                
client.invoke("sendNewMessage", "PRIW", xmlContent);
--

with the code generated by wsdl2java using the -frontend jaxws21 option. The 
basic stuff works except that I get a 

org.apache.ws.security.WSSecurityException: An error was discovered processing 
the <wsse:Security> header

which is no surprise since I couldn't find a way to specify username and 
password for the generated java code.

The question is:  How do I supply username and password for the code generated 
by wsdl2java ?

Regards
  Roger

Reply via email to