ferrarisp

webSer_cliente

Nov 13th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. <?php
  2.     // cliente.php
  3.     // http://www.thiengo.com.br
  4.     include('lib/nusoap.php');
  5.    
  6.     $cliente = new nusoap_client('http://localhost/codigo/webSevices/02/servidor.php?wsdl');
  7.    
  8.     $parametros = array('nome'=>'Teste','idade'=>51);          
  9.        
  10.     $resultado  =   $cliente->call('exemplo', $parametros);
  11.     $result     =   $cliente->call('listaProdutos');
  12.    
  13.     # apresentação das chamadas ao webservice
  14.    
  15.     echo utf8_encode($resultado);  
  16.     print('<br> <br>');
  17. ?>
  18.  
  19. <select>
  20.   <?php
  21.    
  22.         //exibe o resultado
  23.         $top = sizeof($result) - 1;
  24.         $bottom = 0;
  25.         while($bottom <= $top)
  26.         {
  27.             echo '<option value='.$result[$bottom].'>'.$result[$bottom].'</option>';
  28.             $bottom++;
  29.         }
  30.   ?>
  31.  
  32. </select>
Advertisement
Add Comment
Please, Sign In to add comment