Created
April 1, 2017 07:12
-
-
Save jjcodes78/4fd73a8b2fa1dffeb2ba36d961777c02 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use SoapClient; | |
class SoapController extends Controller | |
{ | |
public function show() | |
{ | |
$client = new SoapClient('https://servicos.saude.gov.br/cnes/EstabelecimentoSaudeService/v1r0?wsdl'); | |
$client->__setSoapHeaders(new WsseAuthHeader('CNES.PUBLICO', 'cnes#2015public')); | |
$cnesEstabelecimento = '9020535'; | |
$requestConsultarEstabelecimentoSaude = [ | |
'FiltroPesquisaEstabelecimentoSaude' => [ | |
'CodigoCNES' => [ | |
'codigo' => $cnesEstabelecimento | |
] | |
] | |
]; | |
$response = json_decode(json_encode($client->consultarEstabelecimentoSaude($requestConsultarEstabelecimentoSaude)), true); | |
return $response; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment