I am trying to call a function on a web service defined on a Tomcat server, but I can not make the call due to a credentials failure.
The structure of this web service asks for a Basic Authorization embedded on the envelope (not the header itself). Using the SOAPui tool I have no problem to make this call entering the username and password. But using the PHP client is not possible to access the web service.
I have already tried to use nusoal library which actually works, but it doesn't help with the parameters because I can not filter the query. I mean is like this call doesn't use the parameters at all returning all the results.
I would like to give it a try with the default soapClient.
<?php
$username = "user";
$password = "pass";
$wsdl = 'http://192.168.1.185:8080/msw/gestionSolicitudes?wsdl';
$options = array(
'Username' => $username,
'Password' => $password,
);
$client = new SoapClient($wsdl, $options);
$parametros = array("statusId"=>2, "startDate"=>'2019-01-01', "endDate"=>'2019-09-01', "name"=>'Maria');
$result = $client->__soapCall('getSolicitudesLista', $parametros);
foreach ($result as &$valor) {
foreach ($valor as &$solicitud) {
if (is_object($solicitud)) {
echo nl2br (">>>Solicitud init ============================================\r\n");
....
} else {
echo nl2br (">>>Result ============================================\r\n\r\n");
var_dump($solicitud);
echo nl2br (">>>Result ============================================\r\n\r\n");
}
}
}
?>