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
  •  | 
  •  

Вопрос

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));
Это было полезно?

Решение

Have you tried setting it in the options array?

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

$client = new SoapClient($wsdl, $options);
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top