Advertisement
Guest User

Untitled

a guest
Jun 17th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.20 KB | None | 0 0
  1.  
  2.  
  3. $server->register('recoverEvents',
  4.         array('AplicationName' => 'xsd:string',
  5.         ),
  6.         array('return' => 'array[]'),   //tns:estructura
  7.               'urn:convertwsdl',
  8.               'urn:convertwsdl#recoverEvents',
  9.               'rpc',
  10.               'encoded',
  11.               'Recupera los eventos realizados en el visor'
  12. );
  13.  
  14.  
  15. function recoverEvents($AplicationName)
  16. {  
  17.     $dbhost = 'localhost';
  18.     $dbuser = 'jgquirogamcastro';
  19.     $dbpass = 'axiacore';
  20.     $dbname = "test";
  21.     $con = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error conectando A mysql');
  22.     if (!$con)
  23.     {   return 255;
  24.     // si no ahy conexion a la base de datos retorna 255
  25.     }
  26.    
  27.     mysql_select_db($dbname, $con);
  28.    
  29.     $query = ("SELECT `fecha/hora`, `session`, `usuario`, `aplicacion`, `codigo_interno_aplicacion`, `accion` FROM `auditoria` WHERE
  30.    aplicacion = '$ApplicationName'");
  31.    
  32. $result = mysql_query($query, $con);
  33. //$numrows=mysql_num_rows ($result);
  34.  
  35.   $response = array();
  36.  
  37.    while ($row = mysql_fetch_assoc($result)) {
  38.       array_push($response, $row);
  39.       }
  40.  
  41.     return $response;  
  42. //for($x = 0; $x < $numrows; $x++) {
  43. //$tabla[]= mysql_fetch_array($result);
  44. //}
  45.  
  46. //$aux=("2010-09-27 11:10:49","root","positiva","47389","imprimio");
  47. //var_dump($tabla);
  48. //return $tabla;
  49.  
  50. //return $aux;
  51. //return $html;
  52.  
  53. //return json_encode($html);
  54. }
  55.  
  56.  
  57. $server->wsdl->addComplexType(
  58. 'registro',
  59. 'complexType',
  60. 'struct',
  61. 'all',
  62. '',
  63. array(
  64. 'fecha/hora'=>array('fecha' => 'fecha/hora', 'type' => 'xsd:string'),
  65. 'session'=>array('Session' => 'session', 'type' => 'xsd:string'),
  66. 'usuario'=>array('Usuario' => 'usuario', 'type' => 'xsd:string'),
  67. 'aplicacion'=>array('Aplicacion' => 'aplicacion', 'type' => 'xsd:string'),
  68. 'codigo_interno_aplicacion'=>array('Codigo_interno_aplicacion' => 'codigo_interno_aplicacion', 'type' => 'xsd:string'),
  69. 'accion'=>array('Accion' => 'accion', 'type' => 'xsd:string')  
  70. )
  71. );  
  72. //fecha/hora`, `session`, `usuario`, `aplicacion`, `codigo_interno_aplicacion
  73. $server->wsdl->addComplexType('estructura', 'complexType', 'array', '',
  74. 'SOAP-ENC:Array', array(),
  75. array(array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:registro[]')),
  76. 'tns:registro');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement