function obterTokenSms() { // $client = new // SoapClient("https://www.smsbahia.com.br/app/webservices/servico/servicocmk.php?wsdl"); $client = new SoapClient ( "http://www.randernet.com/smsbahia/app/webservices/servico/servicocmk.php?wsdl" ); try { $obj = $client->obterAutenticacao ( 'cide', 'cide5m5' ); } catch ( Exception $e ) { echo "ERRO: " . $e->getMessage (); } // foreach($obj as $tokenResul){ // $resul = $tokenResul->result; // $token = $tokenResul->token; // } return $obj; }
<? include ('../geral/geral_inicio_fim.php'); // Arquivo que contem as funçoes // principais de logon do usuario e // empresa e conexão do banco de // dados include ('../geral/validacoes.php'); inicializar ( 'adm', "" ); echo "<br>"; ini_set ( "soap.wsdl_cache_enabled", "0" ); $client = new SoapClient ( "https://www.smsbahia.com.br/app/webservices/servico/servicocmk.php?wsdl" ); try { $obj = $client->obterAutenticacao ( 'cide', 'cide5m5' ); // print_r($obj); } catch ( Exception $e ) { echo "ERRO: " . $e->getMessage (); } foreach ( $obj as $tokenResul ) { $resul = $tokenResul->result; $token = $tokenResul->token; } // echo "RESUL:". $obj -> WSToken; if ($resul == 100) { echo "<p aling = 'center'><BR><font color= 'green'><b>CONECTADO <br> TOKEN: " . $token . "</b></font></p>"; $client = new SoapClient ( "https://www.smsbahia.com.br/app/webservices/servico/servicocmk.php?wsdl" ); try {