WSCOMUN  2.1.0
Web Services Comunes para PHP/GVHidra
WSClientSALT.php
1 <?php
2 namespace WSCOMUN\SALT;
4 use Exception;
16 {
17 
25  public function castellanoValenciano ($texto)
26  {
27  $opcionesClienteWS = array (
28  'soap_version' => SOAP_1_1, //SOAP 1.2
29  'user_agent' => 'WSSSoapClient',
30  'exceptions' => true,
31  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
32  'trace' => self::$MYSOAPOP_TRACE
33  );
34 
35  $clienteWS = null;
36  try
37  {
38  $this->__clienteOn(self::KEYCLIENTE_SALT, true, $opcionesClienteWS);
39  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_SALT];
40  $textoTraducido = $clienteWS->castellanoValenciano($texto);
41  if (is_object($textoTraducido))
42  {
43  return ($textoTraducido->texto);
44  }
45  else
46  {
47  return ($textoTraducido);
48  }
49  }
50  catch (Exception $e)
51  {
52  if ($this->getDebugMode())
53  {
54  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
55  if (is_object($clienteWS))
56  {
57  $this->addDebugInfo("RqH:\n ".$clienteWS->__getLastRequestHeaders());
58  $this->addDebugInfo("Rq:\n ".$clienteWS->__getLastRequest());
59  $this->addDebugInfo("RsH:\n ".$clienteWS->__getLastResponse());
60  $this->addDebugInfo("Rs:\n ".$clienteWS->__getLastResponseHeaders());
61  }
62  throw $e;
63  }
64  else
65  {
66  throw $e;
67  }
68  }
69  }//castellanoValenciano
70 
71 
79  public function valencianoCastellano ($texto)
80  {
81  $opcionesClienteWS = array (
82  'soap_version' => SOAP_1_1, //SOAP 1.2
83  'user_agent' => 'WSSSoapClient',
84  'exceptions' => true,
85  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
86  'trace' => self::$MYSOAPOP_TRACE
87  );
88 
89  try
90  {
91  $this->__clienteOn(self::KEYCLIENTE_SALT, true, $opcionesClienteWS);
92  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_SALT];
93  $textoTraducido = $clienteWS->valencianoCastellano($texto);
94  if (is_object($textoTraducido))
95  {
96  return ($textoTraducido->texto);
97  }
98  else
99  {
100  return ($textoTraducido);
101  }
102  }
103  catch (Exception $e)
104  {
105  if ($this->getDebugMode())
106  {
107  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
108  if (is_object($clienteWS))
109  {
110  $this->addDebugInfo("RqH:\n ".$clienteWS->__getLastRequestHeaders());
111  $this->addDebugInfo("Rq:\n ".$clienteWS->__getLastRequest());
112  $this->addDebugInfo("RsH:\n ".$clienteWS->__getLastResponse());
113  $this->addDebugInfo("Rs:\n ".$clienteWS->__getLastResponseHeaders());
114  }
115  throw $e;
116  }
117  else
118  {
119  throw $e;
120  }
121  }
122  }//valencianoCastellano
123 
124 }
125 
126 ?>
__clienteOn($tipo, $trazabilidadPai=true, $opcionesClienteWS=null)