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. Here's the script:
!IMPORTANT: O tipo de autenticação é (Basic auth)
$credenciais = self::fncGeraAuth();
//array que contem user e senha para autenticação
//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);
//tentado acessar uma função do webservice passando um parametro
var_dump($result);
exit();
Erro:
SoapFault: SOAP-ERROR: Parsing WSDL: Couldn't load from '
...........?wsdl' : failed to load external entity ".........wsdl"