PHP SOAP : Fatal error: Uncaught SoapFault exception: [HTTP] An Authentication object was not found in the SecurityContext

StackOverflow https://stackoverflow.com/questions/18402968

  •  26-06-2022
  •  | 
  •  

Pergunta

I have the following error:

"PHP SOAP : Fatal error: Uncaught SoapFault exception: [HTTP] An Authentication object was not found in the SecurityContext"

I have tried to set up soap headers but it is not working:

$authvalues = array("username"=>"@@@@","password"=>"EEEEE");
$header =  new SoapHeader("SoapBaseNameSpace","ReqHeader", $authvalues, true);

$client->__setSoapHeaders(array($header));
Foi útil?

Solução

Have you tried setting it in the options array?

$options = array(
  "login" => 'login',
  "password" => 'pass'
);

$client = new SoapClient($wsdl, $options);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top