Skip to content

Commit 0e4a0f1

Browse files
Add location na chamada do webservice
Corrige um problema onde era retornado o erro: Could not connect to host
1 parent 7d8f19d commit 0e4a0f1

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/Soap.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ public function setWsdl($wsdl, array $opcoes = null)
3939
'cache_wsdl' => 'WSDL_CACHE_NONE',
4040
'soap_version' => 'SOAP_1_2',
4141
'trace' => 1,
42-
'encoding' => 'UTF-8'
42+
'encoding' => 'UTF-8',
43+
// Corrige um problema onde era retornado o erro: Could not connect to host
44+
'location' => substr($wsdl, 0, -5)
4345
];
4446
}
4547

@@ -53,18 +55,18 @@ public function setWsdl($wsdl, array $opcoes = null)
5355
/**
5456
* Dispara a consulta contra o serviço informado
5557
*
56-
* @param string $acao
58+
* @param string $servico
5759
* @param array $argumentos
5860
* @return null|string null = sucesso, string = erro
5961
*/
60-
public function consult($acao, array $argumentos = null)
62+
public function consult($servico, array $argumentos = null)
6163
{
6264
try {
6365
if(!$this->client) {
64-
throw new Exception("Ocorreu um erro ao tentar chamar o serviço <b>{$acao}</b>.");
66+
throw new Exception("Ocorreu um erro ao tentar chamar o serviço <b>{$servico}</b>.");
6567
}
6668

67-
$this->client->__soapCall($acao, $argumentos);
69+
$this->client->__soapCall($servico, $argumentos);
6870
} catch (Exception $e) {
6971
return $e->getMessage();
7072
}

0 commit comments

Comments
 (0)