I'm having a problem with authentication when I try to consume a web service soap. When entering with the url in the browser, it appears u dailog requesting user and password. But I need to do this authentication without this dialog being presented, that is, all authentication in the back end. I tried to pass the login and password through SoapHeader but without success. Note: the web-service is written in Java. Here's the script:
//!IMPORTANT: O tipo de autenticação é (Basic auth)
$credenciais = self::fncGeraAuth();
//array containing user and password for authentication
//Array ( [UserName] => xxxxx [Password] => xxxxx)
$_rCliente2 = new SoapClient($wsdl, array("encoding" => "ISO-8859-1"));
$Header = new SoapHeader($wsdl,'Authorization', $credenciais, false);
$_rCliente2->__setSoapHeaders($Header);
$result = $_rCliente2->fncRecuperaPapel($Instituição);
var_dump($result);
exit();
Error:
SoapFault: SOAP-ERROR: Parsing WSDL: Couldn't load from ' ...........?wsdl' : failed to load external entity ".........wsdl"
I do not have much experience with webservice consumption and if someone can help me I appreciate it