I wanted to avoid defining credentials in a proxy parameter and so investigated further.
I think the server rejects the connection and doesn't ask for the credentials again. The get_basic_credentials method is probably called as later as in this moment.
So I added an Authorization header this way:
$authoriz = 'Basic '.encode_base64('user:passwd');
$soap->transport->http_request->headers->push_header('Authorization'=>
+$authoriz);
encode_base64 is a function from MIME::Base64 module.
And this way it's ok now.