Code example for PasswordAuthentication

0
        try { 
            factory = ConnectionFactory.newInstance();
            factory.setProperties(scoutProperties);
            connection = factory.createConnection();
 
            PasswordAuthentication passwdAuth = new PasswordAuthentication(userid,
                    passwd.toCharArray());
            Set<PasswordAuthentication> creds = new HashSet<PasswordAuthentication>();
            creds.add(passwdAuth);
 
            connection.setCredentials(creds);
            System.out.println("\n*********Connection established with UDDI Registry************");
        } catch (JAXRException e) {
            e.printStackTrace();
        } 
    } 
}