Last active
April 1, 2017 06:51
-
-
Save jjcodes78/aa95a7f7f552465c90ad5876eca1bea1 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
// JJSQUADY (Jorge Alberto Junior) | |
// Abril/2017 | |
// ------------------------------------------------------------------------------------------------------------------------- | |
// Insira este código dentro de uma function | |
// Se quiser passar o CNES via parâmetro basta comentar o $cnesEstabelecimento e usar essa variável como argumento da função | |
// não esqueça de importar a classe WsseAuthHeader | |
$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