spring-projects / spring-ws

Spring Web Services
https://spring.io/projects/spring-ws
Apache License 2.0
316 stars 303 forks source link

Convenience constructor for SimpleUsernamePasswordCallbackHandler [SWS-745] #834

Closed gregturn closed 12 years ago

gregturn commented 12 years ago

Eirik Lygre opened SWS-745 and commented

The class org.springframework.ws.soap.security.xwss.callback.SimpleUsernamePasswordCallbackHandler has two properties "username" and "password", and only a default constuctor. When using this class, I always find myself writing this code:

SimpleUsernamePasswordCallbackHandler callback = new SimpleUsernamePasswordCallbackHandler ();
callback.setUsername(username);
callback.setPassword(password);
doSomething(callback);

Of course, I'd love to write this instead, which would be a, hm, productivity booster?

doSomething(new SimpleUsernamePasswordCallbackHandler (username, password));

Hence, the request: Add the required constructors to make this work:

public class SimpleUsernamePasswordCallbackHandler extends AbstractCallbackHandler implements InitializingBean {
   ...
   public SimpleUsernamePasswordCallbackHandler ();
   public SimpleUsernamePasswordCallbackHandler (String username, String password);
   ...
}

Affects: 2.0.3

Attachments:

Referenced from: commits https://github.com/spring-projects/spring-ws/commit/0f277d4e4a06c7e5b73a21495d5cb79fb83e372f

gregturn commented 12 years ago

jaminh commented

Here is a patch for the new constructor

gregturn commented 12 years ago

Arjen Poutsma commented

Closing old issues