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