I ran into the problem of adding a header http
to a type request SOAP
in php , I was trying to do it like this:
$resourceEndPoint = "http://192.168.10.28:55823/Servicios/Pagos.svc";
$MPClient = new SoapClient($resourceEndPoint . "?wsdl",
array(
'soap_version' => 'SOAP_1_2',
'location' => $resourceEndPoint,
'trace' => true,
'exceptions' => true
)
);
$header = new SoapHeader('http://192.168.10.28:55823/Servicios/',
'Authorization',
'QWxndW5hQ2FkZW5h');
$MPClient->__setSoapHeaders($header);
The problem is that the way I was doing it was incorrect since the header was not going to be read as
http
if not, likesoap
, I was able to solve my problem by adding the header via astream_context
directly in my client optionssoap
as follows :