Hello, everyone.
I'm trying to consume the "pesquisar"
function of the CADSUS bus, but I get the error as a response
"Forced circuit exception";
The code used below is using Laravel 5.6 and PHP 7.1 :
Route::get('/ws/teste', function () {
try {
$opts = array(
'http' => array(
'user_agent' => 'PHPSoapClient'
)
);
$context = stream_context_create($opts);
$wsdlUrl = 'https://servicoshm.saude.gov.br/cadsus/CadsusService/v5r0?wsdl';
$soapClientOptions = array(
'trace' => 1,
'stream_context' => $context,
'cache_wsdl' => WSDL_CACHE_NONE,
'Username' => 'CADSUS.CNS.PDQ.PUBLICO',
'Password' => 'kUXNmiiii#RDdlOELdoe00966'
);
$client = new SoapClient($wsdlUrl, $soapClientOptions);
$parameters = array(
'CNESUsuario' => array(
'CNES' => '6963447',
'Usuario' => 'LEONARDO',
'Senha' => ''
),
'FiltroPesquisa' => array(
'nomeCompleto' => 'SERGIO ARAUJO CORREIA LIMA',
'tipoPesquisa' => 'IDENTICA'
),
'higienizar' => 0
);
$result = $client->pesquisar($parameters);
print_r($result);
}
catch(\Exception $e) {
echo $e->getMessage();
} });
If anyone knows what might be happening, please help me!