@Andrea:
Try to use something like this before instantiating the service:
Authenticator.setDefault(new Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username,password.toCharArray());
}
});
Where username & password are Strings.
(maybe you want to see: http://download.oracle.com/javase/1.4.2/docs/api/java/net/Authenticator.html as well)