java Apache Cxf l'authentification HTTP

J'ai WSDL. J'ai besoin de faire HTTP de base (préemptif) d'authentification.
Que faire?

J'ai essayé :

Authenticator myAuth = new Authenticator() {
    @Override
    protected PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication("user", "pass".toCharArray());
    }
};
Authenticator.setDefault(myAuth);

Mais il ne fonctionne pas: Causée par:

java.io.IOException: le Serveur a renvoyé le code de réponse HTTP: 401 URL ..

P. S.-je utiliser Apache CXF 2.6.2 et JBoss 5.0.1

Je ne sais pas pourquoi quelqu'un downvoted cette question. J'ai le même problème

OriginalL'auteur Bera | 2012-10-15