-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathestabelecimento-completo.php
More file actions
42 lines (32 loc) · 996 Bytes
/
estabelecimento-completo.php
File metadata and controls
42 lines (32 loc) · 996 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
include "ws-security.php";
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Estabelecimento de Saúde</title>
</head>
<body>
<?php
$options = array( 'location' => 'https://servicos.saude.gov.br/cnes/CnesService/v1r0',
'encoding' => 'utf-8',
'soap_version' => SOAP_1_2,
'connection_timeout' => 0,
'trace' => 1,
'exceptions' => 1 );
$client = new SoapClient('https://servicos.saude.gov.br/cnes/CnesService/v1r0?wsdl', $options);
$client->__setSoapHeaders(soapClientWSSecurityHeader('CNES.PUBLICO', 'cnes#2015public'));
$function = 'consultarEstabelecimentoSaude';
// Este serviço não retorna alguns estabelecimentos que possuem um envelope de retorno maior que 10MB
$arguments= array( 'cnes' => array(
'CodigoCNES' => array(
'codigo' => '2530031'
)
)
);
$result = $client->__soapCall($function, $arguments);
print("<pre>".print_r($result,true)."</pre>");
?>
</body>
</html>