示例#1
0
 /**
  *
  * @param <type> $nombre
  * @param <type> $valor un string
  * @param boolean si desea convertir el valor automaticamente de latin1 a utf8
  */
 function add_atributo($nombre, $valor, $conv_utf8 = false)
 {
     $this->xml->startAttribute($nombre);
     if (is_bool($valor)) {
         $valor = $valor ? 'TRUE' : 'FALSE';
     }
     if ($conv_utf8) {
         $this->xml->text(utf8_e_seguro($valor));
     } else {
         $this->xml->text($valor);
     }
     $this->xml->endAttribute();
 }
 /**
  * Permite agregar parametros a pasar al reporte
  * @param string $nombre nombre del parametro
  * @param string $tipo 'D' = fecha, 'E' = entero, 'S' = string/char/varchar, 'F' = decimal/punto flotante
  * @param string $valor valor del parametro
  */
 function set_parametro($nombre = '', $tipo = 'E', $valor = 0)
 {
     if (!($tipo == 'D' || $tipo == 'E' || $tipo == 'S' || $tipo == 'F')) {
         throw new toba_error("Tipo incorrecto de parametro");
     }
     switch ($tipo) {
         case 'D':
             $tipo = "java.util.Date";
             break;
         case 'S':
             $tipo = "java.lang.String";
             $valor = utf8_e_seguro($valor);
             break;
         case 'E':
             $tipo = "java.lang.Integer";
             break;
         case 'F':
             $tipo = "java.math.BigDecimal";
             break;
         default:
             $tipo = "java.lang.String";
             $valor = utf8_e_seguro($valor);
             break;
     }
     //Seteo el parametro
     $this->parametros->put($nombre, new Java($tipo, $valor));
 }
示例#3
0
 /**
  * Rutea WSF hacia la extensión
  */
 function __call($nombre, $argumentos)
 {
     $srv_name = $this->_solicitud->get_id_operacion();
     if (!self::esta_activo($srv_name)) {
         toba::logger_ws()->debug('Se intento acceder a un servicio web inactivo: ' . $srv_name);
         toba::logger_ws()->set_checkpoint();
         throw new WSFault('Receiver', ' El servicio no esta activo');
     }
     //trac/toba/wiki/Referencia/ServiciosWeb/Seguridad
     if (!isset(self::$opciones['securityToken']) && self::servicio_con_firma()) {
         if (toba::instalacion()->es_produccion()) {
             throw new toba_error_seguridad("El servicio web esta configurado para requerir firma, sin embargo no se esta encriptando/firmando la conexion");
         } else {
             throw new toba_error_servicio_web("El servicio web esta configurado para requerir firma, sin embargo no se <a target='_blank' href='http://repositorio.siu.edu.ar/trac/toba/wiki/Referencia/ServiciosWeb/Seguridad#configuracion'>configuro correctamente</a> el servicio importando los certificados de los clientes.");
         }
     }
     //Elimina el guion bajo inicial y llama al metodo op__X
     toba::logger_ws()->debug("Metodo invocado: {$nombre}");
     toba::logger_ws()->debug('Argumentos recibidos');
     toba::logger_ws()->var_dump($argumentos);
     toba::logger_ws()->set_checkpoint();
     if (substr($nombre, 0, 1) != '_') {
         throw new BadMethodCallException('Call to undefined method ' . __CLASS__ . '::' . $nombre);
     }
     $metodo = substr($nombre, 1);
     toba::solicitud()->set_metodo_invocado($metodo);
     $this->mensaje_entrada = new toba_servicio_web_mensaje($argumentos[0]);
     try {
         if ($this->servicio_con_firma()) {
             $this->validar_certificado_cliente();
         }
         $mensaje_salida = $this->{$metodo}($this->mensaje_entrada);
         if (isset($mensaje_salida)) {
             $mensaje = $mensaje_salida->wsf();
             return $mensaje;
         } else {
             toba::logger_ws()->debug("Respuesta de retorno vacía");
             toba::logger_ws()->set_checkpoint();
             return;
         }
     } catch (toba_error_servicio_web $e) {
         toba::logger_ws()->error("Excepción lanzada: " . $e->get_mensaje() . ". Más detalles: " . $e->get_mensaje_log());
         toba::logger_ws()->set_checkpoint();
         toba::logger()->error("Excepción lanzada: " . $e->get_mensaje() . ". Más detalles: " . $e->get_mensaje_log());
         toba::solicitud()->registrar();
         throw new WSFault("Sender", utf8_e_seguro($e->get_mensaje()), null, $e->get_codigo());
     }
 }
示例#4
0
 static function encode($valor)
 {
     $valor = str_replace('&#039;', '&apos;', htmlspecialchars($valor, ENT_QUOTES, 'ISO-8859-1'));
     $valor = utf8_e_seguro($valor);
     return $valor;
 }