Last active
November 20, 2017 18:49
-
-
Save lucasferreira/cea21205b0554895d14d755a33379fd4 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 | |
try { | |
$wsUrl = "HTTP://URL_COMPLETA_DO_WEBSERVICE?WSDL"; // normalmente as URLs de WS contém esse `?WSDL` no final... | |
$clientSoap = new SoapClient($wsUrl, array( | |
'features' => SOAP_SINGLE_ELEMENT_ARRAYS, | |
"trace" => true, | |
"encoding" => "utf-8", | |
"exceptions" => true, | |
"connection_timeout" => 120, | |
"cache_wsdl" => WSDL_CACHE_NONE, | |
)); | |
$result = $clientSoap->NOME_DO_METODO_DISPONIBILIZADO(array("PARAMETRO" => "VALOR")); | |
print_r($result); | |
} catch(SoapFault $ex) { | |
print_r($ex); // erro na tentativa de consumo | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment