Advertisement
ferrarisp

webSev_server

Nov 13th, 2018
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 KB | None | 0 0
  1. <?php
  2.     // http://www.thiengo.com.br
  3.     // servidor.php
  4.     include('lib/nusoap.php');
  5.    
  6.     $servidor = new nusoap_server();
  7.    
  8.     $servidor->configureWSDL('urn:Servidor');
  9.     $servidor->wsdl->schemaTargetNamespace = 'urn:Servidor';
  10.    
  11.     $servidor->register(
  12.         'exemplo',
  13.         array('nome'=>'xsd:string',
  14.                 'idade'=>'xsd:int'),
  15.         array('retorno'=>'xsd:string'),
  16.         'urn:Servidor.exemplo',
  17.         'urn:Servidor.exemplo',
  18.         'rpc',
  19.         'encoded',
  20.         'Informações com o desenvolvedor'
  21.     );
  22.    
  23.     $servidor->register(
  24.         'listaProdutos',
  25.         array(),
  26.         array(),
  27.         'urn:Servidor.exemplo',
  28.         'urn:Servidor.exemplo',
  29.         'rpc',
  30.         'encoded',
  31.         'Informações com o desenvolvedor'
  32.         );
  33.    
  34.     function exemplo($nome, $idade)
  35.     {
  36.         return($nome.' -> '.$idade);
  37.     }
  38.    
  39.     function listaProdutos()
  40.     {
  41.         $produtos = array("volvo","saab","mercedes","audi","fiat","bmw");      
  42.         return $produtos;
  43.     }
  44.        
  45.     $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
  46.     $servidor->service($HTTP_RAW_POST_DATA);
  47. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement