WSComun  1.6.5
Web Services Comunes para PHP/GVHidra
WSComunClient.php
1 <?php
18 define('DEBUG', false);
19 
23 require_once 'WSSSoapClient.php';
24 
25 
53 {
57  const KEYCLIENTE_AUTENTICA = 'autentica';
58  const KEYCLIENTE_AUTORIZA = 'autoriza';
59  const KEYCLIENTE_FIRMA = 'firma';
60  const KEYCLIENTE_GDE = 'gde';
61  const KEYCLIENTE_SALT = 'salt';
62  const KEYCLIENTE_CSV = 'csv';
63  const KEYCLIENTE_CATASTRO = 'catastro';
64  const KEYCLIENTE_CATASTRO_BIENES = 'catbienes';
65  const KEYCLIENTE_GDE2 = 'gde2';
66  const KEYCLIENTE_PF = 'pfcons';
67  const KEYCLIENTE_PF_MOD = 'pfmod';
68  const KEYCLIENTE_PF_ADM = 'pfadm';
69 
70 
74  const TIPOBUSQUEDA_USUARIO = 'USUARIO';
75  const TIPOBUSQUEDA_GRUPO = 'GRUPO';
76 
77 
78 
84  private static $MYSOAPOP_TRACE = true; //Necesario para tratar las cabeceras MTOM
85  private static $MYSOAPOP_WSDL_CACHE = WSDL_CACHE_BOTH;//Desarrollo WSDL_CACHE_NONE, produccion WSDL_CACHE_BOTH
86 
87 
88 
92  private static $NAMESPACE_GVA = 'http://dgm.gva.es/ayf/war/schemas/v2_00';
93  private static $NAMESPACE_GDE = 'urn:es:gva:dgm:tra:gde:vista:model';
94  private static $NAMESPACE_SALT = 'http://salt.ws.edu.gva.es/';
95  private static $NAMESPACE_CSVGVA = 'urn:es:gva:dgm:tra:csvgva';
96  private static $NAMESPACE_GDE2 = 'urn:es:gva:dgm:tra:gde:vista:v2:model';
97  private static $NAMESPACE_CAT_ESP = 'http://intermediacion.redsara.es/scsp/esquemas/datosespecificos';
98  private static $NAMESPACE_CAT_PET = 'http://intermediacion.redsara.es/scsp/esquemas/V3/peticion';
99  private static $NAMESPACE_CAT_SR = 'http://intermediacion.redsara.es/scsp/esquemas/V3/solicitudRespuesta';
100  private static $NAMESPACE_PF = null; // 'urn:juntadeandalucia:cice:pfirma:type:v2.0';
101  private static $NAMESPACE_PF_MOD = null; // 'urn:juntadeandalucia:cice:pfirma:type:v2.0';
102  private static $NAMESPACE_PF_ADM = null; // 'urn:juntadeandalucia:cice:pfirma:type:v2.0';
103 
108  private $v_wsdl;
109 
110 
116  private $WSDLTimeOut;
117 
123  private $v_clienteWS;
124 
125 
131  private $keyFile='';
132 
138  private $passPhrase=null;
139 
145  private $certFile='';
146 
147 
151  private $certSerial=null;
152 
158  private $_debugMode;
159 
165  private $_debugInfo;
166 
172  protected $vTrazabilidad;
173 
179  protected $enableWSSecurity = true;
180 
181 
194  public function __construct($v_wsdl, $v_datosCertif, $idAPP=null)
195  {
196 
197  //Inicializamos el array asociativo de clientes
198  $this->v_clienteWS = array
199  (
200  self::KEYCLIENTE_AUTENTICA => null,
201  self::KEYCLIENTE_AUTORIZA => null,
202  self::KEYCLIENTE_CATASTRO => null,
203  self::KEYCLIENTE_CATASTRO_BIENES => null,
204  self::KEYCLIENTE_CSV => null,
205  self::KEYCLIENTE_FIRMA => null,
206  self::KEYCLIENTE_GDE => null,
207  self::KEYCLIENTE_GDE2 => null,
208  self::KEYCLIENTE_PF => null,
209  self::KEYCLIENTE_PF_ADM => null,
210  self::KEYCLIENTE_PF_MOD => null,
211  self::KEYCLIENTE_SALT => null,
212  );
213 
214 
215  if (!is_array($v_wsdl))
216  {
217  throw new Exception (
218  __CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.
219  'v_wsdl debe ser un array asociativo (autenticacion,autorizacion,firma) con las URI de los WSDL'
220  );
221  }
222  //Inicializamos el array asociativo de URIs WSDL
223  $this->v_wsdl = $v_wsdl;
224 
225  if (!is_array($v_datosCertif))
226  {
227  throw new Exception (
228  __CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.
229  'v_datosCertif debe ser un array asociativo (rutaCert, rutaKey, passphrase) con las rutas a los certificados'
230  );
231  ;
232  }
233  //Fijamos datos del certificado
234  $this->setCertFile($v_datosCertif['certFile']);
235  $this->setKeyFile($v_datosCertif['keyFile']);
236  $this->setPassPhrase($v_datosCertif['passPhrase']);
237 
238 
239  $this->vTrazabilidad = null;
240  if (!empty($idAPP))
241  {
242  $this->vTrazabilidad = array (
243  'idApp'=>$idAPP,
244  'nsCert'=>$this->getCertificateSerial());
245  }
246 
247 
248  /* Opciones de DEBUG y tiempos de espera */
249  $this->setDebugMode(DEBUG);
250  $this->_debugInfo = array();
251  $this->WSDLTimeOut = 20;
252 
253 
254  }//Fin __construct
255 
256  /* ---- Metodos DEBUG ---- */
257 
258 
265  public function getDebugMode()
266  {
267  return($this->_debugMode);
268  }//getDebugMode
269 
270 
277  public function getDebugInfo()
278  {
279  return $this->_debugInfo;
280  }//Fin getDebugInfo
281 
282 
283 
290  public function setDebugMode($activo)
291  {
292  self::$MYSOAPOP_TRACE = true;//Necesario para tratar MTOM
293  $this->_debugMode = $activo;
294  if ($activo)
295  {
296  self::$MYSOAPOP_WSDL_CACHE = WSDL_CACHE_NONE;
297  }
298  else
299  {
300  self::$MYSOAPOP_WSDL_CACHE = WSDL_CACHE_BOTH;
301  $this->_debugInfo = array();//Vaciamos las trazas de debug
302  }
303  }//setDebugMode
304 
305 
312  public function addDebugInfo($info)
313  {
314  if (!empty($info))
315  {
316  $this->_debugInfo[] = $info;
317  }
318 
319  }//addDebugInfo
320 
321 
322 
329  public function setKeyFile($pathKey)
330  {
331  $this->keyFile = $pathKey;
332  }//setKeyFile
333 
334 
341  public function setPassPhrase($passphrase)
342  {
343  $this->passPhrase = $passphrase;
344  }//setPassPhrase
345 
346 
353  public function setCertFile($pathCert)
354  {
355  $this->certFile = $pathCert;
356  }//setCertFile
357 
358 
365  public function setWSDLTimeOut($segs)
366  {
367  $this->WSDLTimeOut = $segs;
368  }//setCertFile
369 
370 
371 
378  public function getCertificateSerial()
379  {
380  $certFile = realpath($this->certFile);
381  $cert = file_get_contents($certFile);
382  $v_certData = openssl_x509_parse($cert, true);
383  $this->certSerial = strtoupper(self::numberBaseConvert($v_certData['serialNumber']));
384  return $this->certSerial;
385  }//getCertificateSerial
386 
387 
394  public function loadTracertPAI($vTrazabilidadPAI)
395  {
396  if (!is_array($vTrazabilidadPAI))
397  {
398  throw new Exception('Las opciones de trazabilidad deben ser un array asociativo');
399  }
400  if (!array_key_exists('idApp', $vTrazabilidadPAI))
401  {
402  throw new Exception('Es necesaria KEY "idApp" con el id CATI de la aplicación');
403  }
404 
405  $this->vTrazabilidad = $vTrazabilidadPAI;
406 
407  if (!array_key_exists('nsCert', $vTrazabilidadPAI))
408  {
409  $this->vTrazabilidad['nsCert'] = $this->getCertificateSerial();
410  }
411  }//loadTracertPAI
412 
413 
418  public function enableWSSecurity()
419  {
420  $this->enableWSSecurity = true;
421  }//enableWSSecurity
422 
423 
428  public function disableWSSecurity()
429  {
430  $this->enableWSSecurity = false;
431  }//disableWSSecurity
432 
433 
434  public function tratarExcepcionEstandar($e, $clienteWS)
435  {
436  if ($this->getDebugMode())
437  {
438  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
439  if (is_object($clienteWS))
440  {
441  $this->addDebugInfo("RqH:\n ".$clienteWS->__getLastRequestHeaders());
442  $this->addDebugInfo("Rq:\n ".$clienteWS->__getLastRequest());
443  $this->addDebugInfo("RsH:\n ".$clienteWS->__getLastResponse());
444  $this->addDebugInfo("Rs:\n ".$clienteWS->__getLastResponseHeaders());
445  }
446  throw $e;
447  }
448  else
449  {
450  throw $e;
451  }
452  }//tratarExcepcionEstandar
453 
454 
455  /* ----------------------------------------------------------------------- */
456  /* ------------------------ Métodos privado propios ---------------------- */
457  /* ----------------------------------------------------------------------- */
469  public static function numberBaseConvert($numstring, $frombase=10, $tobase=16)
470  {
471  $chars = "0123456789abcdefghijklmnopqrstuvwxyz";
472  $tostring = substr($chars, 0, $tobase);
473  $length = strlen($numstring);
474  $result = '';
475  $number = array();
476  for ($i = 0; $i < $length; $i++)
477  {
478  $number[$i] = strpos($chars, $numstring{$i});
479  }
480  do
481  {
482  $divide = 0;
483  $newlen = 0;
484  for ($i = 0; $i < $length; $i++)
485  {
486  $divide = $divide * $frombase + $number[$i];
487  if ($divide >= $tobase)
488  {
489  $number[$newlen++] = (int)($divide / $tobase);
490  $divide = $divide % $tobase;
491  } elseif ($newlen > 0)
492  {
493  $number[$newlen++] = 0;
494  }
495  }
496  $length = $newlen;
497  $result = $tostring{$divide} . $result;
498  } while ($newlen != 0);
499 
500  return $result;
501  }
502 
503 
504 
510  private function tratarRespuestaMTOM($response)//REVIEW: ¿Lo eliminamos?
511  {
512  $vRespuesta = preg_grep("/<[a-z]*:Envelope.*?>(.*)<\/[a-z]*:Envelope>/i", explode("\n", $response));
513  $cadenaRespuesta = array_shift(array_slice($vRespuesta, 0, 1));
514 
515  $dom = new DOMDocument('1.0');
516  $dom->loadXML($cadenaRespuesta);//Cargamo el XML
517  $xpath = new DOMXpath($dom);
518  $vNodoRespuesta = $xpath->query("/*[local-name()='Envelope']/*[local-name()='Body']//*[local-name()='respuesta']");
519  $nodoRespuesta = $vNodoRespuesta->item(0);
520 
521  //Tratamos tipos Mime si existen
522  return $this->xml_to_array($nodoRespuesta);
523  }
524 
525 
526 
536  protected function tratarMTOMEstandar($response, $itemToReturn = null)
537  {
538  $vRespuesta = preg_grep("/<[a-z]*:Envelope.*?>(.*)<\/[a-z]*:Envelope>/i", explode("\n", $response));
539 
540  $vSlice = array_slice($vRespuesta, 0, 1);
541  $cadenaRespuesta = array_shift($vSlice);
542 
543  $dom = new DOMDocument('1.0');
544  $dom->loadXML($cadenaRespuesta);//Cargamo el XML
545  $xpath = new DOMXpath($dom);
546  //$vNodoRespuesta = $xpath->query("/*[local-name()='Envelope']/*[local-name()='Body']/*/*[local-name()='respuesta']");
547  $subStrXpath='';
548  if (!empty($itemToReturn))
549  {
550  $subStrXpath = "/*[local-name()='{$itemToReturn}']";
551  }
552  $vNodoRespuesta = $xpath->query("/*[local-name()='Envelope']/*[local-name()='Body']/*".$subStrXpath);
553  $nodoRespuesta = $vNodoRespuesta->item(0);
554 
555  //Comprobamos si existen anexos
556  $mimeBoundary = '--MIME_Boundary';//Probamos con --MIME Boundary hasta mejora de detección
557  $vBodyResponse = explode($mimeBoundary, $response); //Fraccionamos la respuesta.
558  $numElementos = count($vBodyResponse);
559 
560  if ($numElementos==0)
561  {
562  $mimeBoundary = '--uuid:';//Probamos de nuevo con --uuid hasta mejora de detección
563  $vBodyResponse = explode($mimeBoundary, $response); //Fraccionamos la respuesta.
564  $numElementos = count($vBodyResponse);
565  }
566 
567  if ($numElementos>0)
568  {
569  $oMimeParser = new WSCMimeParser();
570  $oMime = $oMimeParser->decode($response);
571 
572  $vNodoInclude = $xpath->query("//*[local-name()='Include']");
573  foreach ($vNodoInclude as $nodoItem)//Recorremos los nodosXML include y sustituidmos por el contenido
574  {
575  $subIdBuscado = (string) $nodoItem->getAttribute('href');
576  $subIdBuscado = urldecode($subIdBuscado);
577  $idBuscado = '<'.substr($subIdBuscado, 4).'>';
578  foreach ($oMime->parts as $clave => $parte)
579  {
580  $idAnexoMime = $parte->headers['content-id'];
581  if ($idBuscado == $idAnexoMime)
582  {
583  $contenidoB64 = $parte->body;
584  $prefijoMime = strtolower(substr($parte->mimetype,0,4));
585  if ($prefijoMime!=='text')//Si el tipo mime no es texto, convertimos a B64 por ser contenido binario
586  {
587  $contenidoB64 = base64_encode($parte->body);
588  }
589  $textNode = $dom->createTextNode($contenidoB64);
590  $nodoItem->parentNode->replaceChild($textNode, $nodoItem);
591  }
592  }//Fin for partes
593  }//Fin for nodos
594  }
595  $vRepuesta = $this->xml_to_array($nodoRespuesta);
596  return $vRepuesta;
597  }//tratarMTOMEstandar
598 
599 
600 
601  //REVIEW: Tratamineto de MTOM para el portafirmas ¿Podría unificarse?
602  private function tratarMTOM4PF($response, $autoDetectSeparator = false, $crlf = "\n", $itemToReturn = 'respuesta') {
603  // Extraer el separador de bloques
604  $mimeBoundary = '--MIME_Boundary';
605  if ($autoDetectSeparator === true) {
606  $start = 0; // strpos($response, '<?xml');
607  $end = strpos($response, $crlf);
608  $mimeBoundary = substr($response, $start, $end-$start);
609  }
610 
611  // Obtiene la respuesta, y la divide en los bloques de trabajo
612  //REVIEW: ¿Se utiliza vBodyResponse para algo?
613  $vBodyResponse = explode($mimeBoundary, $response); // TODO: SE ASUME LA CADENA SEPARADORA '--MIME_Boundary'
614 
615  // Interpreta e identifica cada bloque
616  $oMimeParser = new WSCMimeParser();
617  $oMime = $oMimeParser->decode($response);
618 
619  // Accede a la respuesta principal
620  $vRespuesta = preg_grep("/<[a-z]*:Envelope.*?>(.*)<\/[a-z]*:Envelope>/i", explode($crlf, $response));
621  $vSlice = array_slice($vRespuesta, 0, 1);
622  $respuestaSoap = array_shift($vSlice);
623 
624  // Accede a la respuesta
625  $dom = new DOMDocument('1.0');
626  $dom->loadXML($respuestaSoap);
627  $xpath = new DOMXpath($dom);
628  $vNodoRespuesta = $xpath->query("/*[local-name()='Envelope']/*[local-name()='Body']//*[local-name()='". $itemToReturn . "']");
629  $nodoRespuesta = $vNodoRespuesta->item(0);
630 
631  // Sustituye los campos MTOM
632  $vNodoInclude = $xpath->query("//*[local-name()='Include']");
633  foreach ($vNodoInclude as $nodoItem)//Recorremos los nodosXML include y sustituidmos por el contenido
634  {
635  $subIdBuscado = (string) $nodoItem->getAttribute('href');
636  $subIdBuscado = urldecode($subIdBuscado);
637  $idBuscado = '<'.substr($subIdBuscado, 4).'>';
638  foreach ($oMime->parts as $clave => $parte)
639  {
640  $idAnexoMime = $parte->headers['content-id'];
641  if ($idBuscado == $idAnexoMime)
642  {
643  $contenidoB64 = $parte->body;
644  if (($parte->mimetype =='content/octet-stream') || ($parte->mimetype =='application/pdf'))
645  {
646  $contenidoB64 = base64_encode($parte->body);
647  }
648  $textNode = $dom->createTextNode($contenidoB64);
649  $nodoItem->parentNode->replaceChild($textNode, $nodoItem);
650  }
651  }//Fin for partes
652  }//Fin for nodos
653 
654  // Convierte la respuesta en un array
655  return $this->xml_to_array($nodoRespuesta);
656  }//tratarMTOM4PF
657 
658 
659  private function xml_to_array($root)
660  {
661  $result = array();
662 
663  if ($root->hasAttributes()) {
664  $attrs = $root->attributes;
665  foreach ($attrs as $attr) {
666  $result['@attributes'][$attr->name] = $attr->value;
667  }
668  }
669 
670  if ($root->hasChildNodes()) {
671  $children = $root->childNodes;
672  if ($children->length == 1) {
673  $child = $children->item(0);
674  if ($child->nodeType == XML_TEXT_NODE) {
675  $result['_value'] = $child->nodeValue;
676  return count($result) == 1 ? $result['_value'] : $result;
677  }
678  }
679  $groups = array();
680  foreach ($children as $child) {
681  if (!isset($result[$child->nodeName])) {
682  $result[$child->nodeName] = $this->xml_to_array($child);
683  } else {
684  if (!isset($groups[$child->nodeName])) {
685  $result[$child->nodeName] = array($result[$child->nodeName]);
686  $groups[$child->nodeName] = 1;
687  }
688  $result[$child->nodeName][] = $this->xml_to_array($child);
689  }
690  }
691  }
692 
693  return $result;
694  }//xml_to_array
695 
696 
697 
698  /* ----------------------------------------------------------------------- */
699  /* --------------------- Subpaquete de autenticación --------------------- */
700  /* ----------------------------------------------------------------------- */
701 
714  public function autenticaUsuarioWS ($user, $pass)
715  {
716  try
717  {
718  $this->__clienteOn(self::KEYCLIENTE_AUTENTICA, true);
719  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_AUTENTICA];
720 
721 
722  $autenticaUsuarioWSRequest = new ArrayObject();
723  $autenticaUsuarioWSRequest->append(new SoapVar($user,XSD_STRING,null,null,'usuarioLDAP', self::$NAMESPACE_GVA));
724  $autenticaUsuarioWSRequest->append(new SoapVar($pass,XSD_STRING,null,null,'pwdLDAP', self::$NAMESPACE_GVA));
725  $miSoapRQ = new SoapVar($autenticaUsuarioWSRequest, SOAP_ENC_OBJECT,null,null,'autenticaUsuarioWSRequest', self::$NAMESPACE_GVA);
726  $token = $clienteWS->autenticaUsuarioWS($miSoapRQ);
727 
728  if ($this->getDebugMode())
729  {
730  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
731  if (is_object($clienteWS))
732  {
733  $this->addDebugInfo("RqH:\n ".$clienteWS->__getLastRequestHeaders());
734  $this->addDebugInfo("Rq:\n ".$clienteWS->__getLastRequest());
735  $this->addDebugInfo("RsH:\n ".$clienteWS->__getLastResponse());
736  $this->addDebugInfo("Rs:\n ".$clienteWS->__getLastResponseHeaders());
737  }
738  }
739 
740  if (is_object($token))
741  if (property_exists($token, 'token'))
742  if (!empty($token->token))
743  return $token;
744 
745  if ($this->getDebugMode())
746  {
747  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.'. Token vacío');
748  }
749 
750  return null;
751  }
752  catch (Exception $e)
753  {
754  $this->tratarExcepcionEstandar($e, $clienteWS);
755  }
756  }//autenticaUsuarioWS
757 
758 
759 
772  public function autenticaUsuarioLDAPWS ($user, $pass)
773  {
774  try
775  {
776  $this->__clienteOn(self::KEYCLIENTE_AUTENTICA, true);
777  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_AUTENTICA];
778 
779  $autenticaUsuarioLDAPWSRequest = new ArrayObject();
780  $autenticaUsuarioLDAPWSRequest->append(new SoapVar($user,XSD_STRING,null,null,'usuarioLDAP', self::$NAMESPACE_GVA));
781  $autenticaUsuarioLDAPWSRequest->append(new SoapVar($pass,XSD_STRING,null,null,'pwdLDAP', self::$NAMESPACE_GVA));
782  $miSoapRQ = new SoapVar($autenticaUsuarioLDAPWSRequest, SOAP_ENC_OBJECT,null,null,'autenticaUsuarioLDAPWSRequest', self::$NAMESPACE_GVA);
783  $token = $clienteWS->autenticaUsuarioLDAPWS($miSoapRQ);
784 
785  if ($this->getDebugMode())
786  {
787  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
788  if (is_object($clienteWS))
789  {
790  $this->addDebugInfo("RqH:\n ".$clienteWS->__getLastRequestHeaders());
791  $this->addDebugInfo("Rq:\n ".$clienteWS->__getLastRequest());
792  $this->addDebugInfo("RsH:\n ".$clienteWS->__getLastResponse());
793  $this->addDebugInfo("Rs:\n ".$clienteWS->__getLastResponseHeaders());
794  }
795  }
796 
797  if (is_object($token))
798  if (property_exists($token, 'token'))
799  if (!empty($token->token))
800  return $token;
801 
802  if ($this->getDebugMode())
803  {
804  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.'. Token vacío');
805  }
806 
807  return null;
808  }
809  catch (Exception $e)
810  {
811  $this->tratarExcepcionEstandar($e, $clienteWS);
812  }
813  }//Fin autenticaUsuarioLDAPWS
814 
815 
828  public function autenticaConFirmaWS ($firmaB64, $codigoEntidad = null)
829  {
830  try
831  {
832  $this->__clienteOn(self::KEYCLIENTE_AUTENTICA);
833  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_AUTENTICA];
834  $autenticaConFirmaWSRequest = new ArrayObject();
835  $autenticaConFirmaWSRequest->append(new SoapVar($firmaB64, XSD_STRING,null,null,'firma', self::$NAMESPACE_GVA));
836  $autenticaConFirmaWSRequest->append(new SoapVar($codigoEntidad,XSD_STRING,null,null,'codigoEntidad', self::$NAMESPACE_GVA));
837  $miSoapRQ = new SoapVar($autenticaConFirmaWSRequest, SOAP_ENC_OBJECT,null,null,'autenticaConFirmaWSRequest', self::$NAMESPACE_GVA);
838  $token = $clienteWS->autenticaConFirmaWS($miSoapRQ);
839  return ($token);
840  }
841  catch (Exception $e)
842  {
843  $this->tratarExcepcionEstandar($e, $clienteWS);
844  }
845  }//Fin autenticaConFirmaWS
846 
847 
848 
868  public function getInformacionWS ($token)
869  {
870  if (empty($token))
871  {
872  if ($this->getDebugMode())
873  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.'. Token vacío');
874 
875  throw new Exception (
876  __CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.
877  '. Token vacío'
878  );
879  }
880 
881  try
882  {
883  $this->__clienteOn(self::KEYCLIENTE_AUTENTICA);
884  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_AUTENTICA];
885  $resultado = $clienteWS->getInformacionWS($token);
886  return $resultado;
887  }
888  catch (Exception $e)
889  {
890  $this->tratarExcepcionEstandar($e, $clienteWS);
891  }
892  }//Fin getInformacionWS
893 
894 
909  public function getInformacionLDAP ($user, $pass)
910  {
911  $resultado = null;
912  try //Autenticación
913  {
914  $token = $this->autenticaUsuarioLDAPWS($user, $pass);
915 
916  if (!is_object($token))//Si no es un objeto
917  {
918  if ($this->getDebugMode())
919  {
920  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.'. Token vacío. No es objeto');
921  }
922  return null;
923  }
924  else
925  {
926  if (!property_exists($token, 'token'))//No existe la property
927  {
928  if ($this->getDebugMode())
929  {
930  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.'. Token vacío. No hay propiedad');
931  }
932  return null;
933  }
934  else
935  {
936  if (empty($token->token)) //La propiedad no tiene valor
937  {
938  if ($this->getDebugMode())
939  {
940  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.'. Token vacío. Propiedad vacía');
941  }
942  return null;
943  }
944  }
945  }
946  }
947  catch (Exception $e)
948  {
949  if ($this->getDebugMode())
950  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
951  throw $e;
952  }
953 
954  try //Información
955  {
956  $resultado = $this->getInformacionWS($token);
957  }
958  catch (Exception $e)
959  {
960  if ($this->getDebugMode())
961  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
962  throw $e;
963  }
964  return $resultado;
965  }//Fin getInformacionLDAP
966 
967 
982  public function getInformacionHDFI ($user, $pass)
983  {
984  $resultado = null;
985  try //Autenticación
986  {
987  $token = $this->autenticaUsuarioWS($user, $pass);
988 
989  if (!is_object($token))//Si no es un objeto
990  {
991  if ($this->getDebugMode())
992  {
993  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.'. Token vacío. No es objeto');
994  }
995  return null;
996  }
997  else
998  {
999  if (!property_exists($token, 'token'))//No existe la property
1000  {
1001  if ($this->getDebugMode())
1002  {
1003  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.'. Token vacío. No hay propiedad');
1004  }
1005  return null;
1006  }
1007  else
1008  {
1009  if (empty($token->token)) //La propiedad no tiene valor
1010  {
1011  if ($this->getDebugMode())
1012  {
1013  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.'. Token vacío. Propiedad vacía');
1014  }
1015  return null;
1016  }
1017  }
1018  }
1019  }
1020  catch (Exception $e)
1021  {
1022  if ($this->getDebugMode())
1023  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
1024  throw $e;
1025  }
1026 
1027  try //Información
1028  {
1029  $resultado = $this->getInformacionWS($token);
1030  }
1031  catch (Exception $e)
1032  {
1033  if ($this->getDebugMode())
1034  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
1035  throw $e;
1036  }
1037  return $resultado;
1038  }//Fin getInformacionHDFI
1039 
1040  /* ----------------------------------------------------------------------- */
1041  /* ------------------- Fin Subpaquete de autenticación ------------------- */
1042  /* ----------------------------------------------------------------------- */
1043 
1044  /* ----------------------------------------------------------------------- */
1045  /* --------------------- Subpaquete de Autorización ---------------------- */
1046  /* ----------------------------------------------------------------------- */
1047 
1058  public function retornaAutorizacionWS ($usuarioHDFI, $idAplicacion)
1059  {
1060  try
1061  {
1062  $this->__clienteOn(self::KEYCLIENTE_AUTORIZA);
1063  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_AUTORIZA];
1064 
1065  $retornaAutorizacionWS = new ArrayObject();
1066  $retornaAutorizacionWS->append(new SoapVar($usuarioHDFI,XSD_STRING,null,null,'usuarioHDFI', self::$NAMESPACE_GVA));
1067  $retornaAutorizacionWS->append(new SoapVar($idAplicacion,XSD_STRING,null,null,'idAplicacion', self::$NAMESPACE_GVA));
1068  $miSoapRQ = new SoapVar($retornaAutorizacionWS, SOAP_ENC_OBJECT,null,null,'retornaAutorizacionWSRequest', self::$NAMESPACE_GVA);
1069 
1070  $lista = $clienteWS->retornaAutorizacionWS($miSoapRQ);
1071 
1072  if ($this->getDebugMode())
1073  {
1074  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
1075  if (is_object($clienteWS))
1076  {
1077  $this->addDebugInfo("RqH:\n ".$clienteWS->__getLastRequestHeaders());
1078  $this->addDebugInfo("Rq:\n ".$clienteWS->__getLastRequest());
1079  $this->addDebugInfo("RsH:\n ".$clienteWS->__getLastResponse());
1080  $this->addDebugInfo("Rs:\n ".$clienteWS->__getLastResponseHeaders());
1081  }
1082  }
1083 
1084  }
1085  catch (Exception $e)
1086  {
1087  $this->tratarExcepcionEstandar($e, $clienteWS);
1088  }
1089 
1090  //Tratamos la información obtenida del WS
1091  try
1092  {
1093  if (!is_object($lista))
1094  {
1095  if ($this->getDebugMode())
1096  {
1097  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
1098  $this->addDebugInfo("\nLista de autorizaciones vacía\n");
1099  }
1100  else
1101  return array();
1102  }
1103 
1104  $vLista = array();
1105  foreach ($lista->permisoapp as $objeto)
1106  {
1107  $vLista[] = array
1108  (
1109  'nif' => $objeto->nif,
1110  'usrTipo' => $objeto->usrtipo,
1111  'idGrupo'=> $objeto->idgrupo,
1112  'idRol' => $objeto->idrol,
1113  'idAplicacion'=>$objeto->idaplicacion
1114  );
1115  }
1116 
1117  return $vLista;
1118 
1119  }
1120  catch (Exception $e)
1121  {
1122  if ($this->getDebugMode())
1123  {
1124  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.'. Error en el tratmineo del objeto lista');
1125  }
1126  }
1127  }//retornaAutorizacionWS
1128 
1129 
1139  public function retornaTodasAutorizacionesWS ($usuarioHDFI)
1140  {
1141  try
1142  {
1143  $this->__clienteOn(self::KEYCLIENTE_AUTORIZA);
1144  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_AUTORIZA];
1145 
1146  $retornaTodasAutorizacionesWS = new ArrayObject();
1147  $retornaTodasAutorizacionesWS->append(new SoapVar($usuarioHDFI,XSD_STRING,null,null,'usuarioHDFI', self::$NAMESPACE_GVA));
1148 
1149  $miSoapRQ = new SoapVar($retornaTodasAutorizacionesWS, SOAP_ENC_OBJECT,null,null,'retornaTodasAutorizacionesWSRequest', self::$NAMESPACE_GVA);
1150 
1151  $lista = $clienteWS->retornaTodasAutorizacionesWS($miSoapRQ);
1152 
1153  if ($this->getDebugMode())
1154  {
1155  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
1156  if (is_object($clienteWS))
1157  {
1158  $this->addDebugInfo("RqH:\n ".$clienteWS->__getLastRequestHeaders());
1159  $this->addDebugInfo("Rq:\n ".$clienteWS->__getLastRequest());
1160  $this->addDebugInfo("RsH:\n ".$clienteWS->__getLastResponse());
1161  $this->addDebugInfo("Rs:\n ".$clienteWS->__getLastResponseHeaders());
1162  }
1163  }
1164 
1165  }
1166  catch (Exception $e)
1167  {
1168  $this->tratarExcepcionEstandar($e, $clienteWS);
1169  }
1170 
1171  //Tratamos la información obtenida del WS
1172  try
1173  {
1174 
1175  if (!is_object($lista))
1176  {
1177  if ($this->getDebugMode())
1178  {
1179  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
1180  $this->addDebugInfo("\nLista de autorizaciones vacía\n");
1181  }
1182  else
1183  return array();
1184  }
1185 
1186  /*
1187  [usrcodigo] => 37178
1188  [usrtipo] => U
1189  [idgrupo] => 380
1190  [idrol] =>
1191  */
1192  $vLista = array();
1193 
1194  //Devuelve un array de objetos, o un sólo objeto. Si es array...
1195  if (is_array($lista->lista_permisos)) foreach ($lista->lista_permisos as $objeto)
1196  {
1197  $vLista[] = array(
1198  'usrCodigo'=> $objeto->usrcodigo,
1199  'usrTipo'=>$objeto->usrtipo,
1200  'idGrupo'=>$objeto->idgrupo,
1201  'idRol'=>$objeto->idrol
1202  );
1203  }
1204  else //Si es un sólo registro
1205  $vLista[] = array(
1206  'usrCodigo'=> $lista->lista_permisos->usrcodigo,
1207  'usrTipo'=>$lista->lista_permisos->usrtipo,
1208  'idGrupo'=>$lista->lista_permisos->idgrupo,
1209  'idRol'=>$lista->lista_permisos->idrol
1210  );
1211 
1212  return $vLista;
1213  }
1214  catch (Exception $e)
1215  {
1216  if ($this->getDebugMode())
1217  {
1218  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.'. Error en el tratmineo del objeto lista');
1219  }
1220  }
1221  }//Fin retornaTodasAutorizacionesWS
1222 
1223 
1224 
1235  public function retornaTodasAutorizacionesDNIWS ($usuarioDNI, $tipoBusqueda)
1236  {
1237  $lista = null;
1238  try
1239  {
1240  $this->__clienteOn(self::KEYCLIENTE_AUTORIZA);
1241  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_AUTORIZA];
1242 
1243  $retornaTodasAutorizacionesDNIWS = new ArrayObject();
1244  $retornaTodasAutorizacionesDNIWS->append(new SoapVar($usuarioDNI,XSD_STRING,null,null,'usuarioDNI', self::$NAMESPACE_GVA));
1245  $retornaTodasAutorizacionesDNIWS->append(new SoapVar($tipoBusqueda,XSD_STRING,null,null,'tipoBusqueda', self::$NAMESPACE_GVA));
1246  $miSoapRQ = new SoapVar($retornaTodasAutorizacionesDNIWS, SOAP_ENC_OBJECT,null,null,'retornaTodasAutorizacionesDNIWSRequest', self::$NAMESPACE_GVA);
1247 
1248  $lista = $clienteWS->retornaTodasAutorizacionesDNIWS($miSoapRQ);
1249 
1250  if ($this->getDebugMode())
1251  {
1252  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
1253  if (is_object($clienteWS))
1254  {
1255  $this->addDebugInfo("RqH:\n ".$clienteWS->__getLastRequestHeaders());
1256  $this->addDebugInfo("Rq:\n ".$clienteWS->__getLastRequest());
1257  $this->addDebugInfo("RsH:\n ".$clienteWS->__getLastResponse());
1258  $this->addDebugInfo("Rs:\n ".$clienteWS->__getLastResponseHeaders());
1259  }
1260  }
1261  }
1262  catch (Exception $e)
1263  {
1264  $this->tratarExcepcionEstandar($e, $clienteWS);
1265  }
1266 
1267  //Tratamos la información obtenida del WS
1268  try
1269  {
1270  if (!is_object($lista))
1271  {
1272  if ($this->getDebugMode())
1273  {
1274  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'."\n");
1275  $this->addDebugInfo("\nLista de autorizaciones vacía\n");
1276  }
1277  else
1278  return array();
1279  }
1280 
1281  $vLista = array();
1282 
1283  //Devuelve un array de objetos, o un sólo objeto. Si es array...
1284  if (is_array($lista->lista)) foreach ($lista->lista as $objeto)
1285  {
1286  $vLista[] = array(
1287  'usrCodigo'=> $objeto->usrcodigo,
1288  'usrTipo'=>$objeto->usrtipo,
1289  'idGrupo'=>$objeto->idgrupo,
1290  'idRol'=>$objeto->idrol
1291  );
1292  }
1293  else //Si es un sólo registro
1294  $vLista[] = array(
1295  'usrCodigo'=> $lista->lista->usrcodigo,
1296  'usrTipo'=>$lista->lista->usrtipo,
1297  'idGrupo'=>$lista->lista->idgrupo,
1298  'idRol'=>$lista->lista->idrol
1299  );
1300 
1301  return $vLista;
1302 
1303  }
1304  catch (Exception $e)
1305  {
1306  if ($this->getDebugMode())
1307  {
1308  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.'. Error en el tratamiento del objeto lista');
1309  }
1310  }
1311  }//retornaTodasAutorizacionesDNIWS
1312 
1313 
1314  /* ----------------------------------------------------------------------- */
1315  /* -------------------- Fin Subpaquete de Autorización ------------------- */
1316  /* ----------------------------------------------------------------------- */
1317 
1318 
1319 
1320 
1321 
1322  /* ----------------------------------------------------------------------- */
1323  /* ------------------------- Subpaquete de Firma ------------------------- */
1324  /* ----------------------------------------------------------------------- */
1325 
1326 
1339  public function firmarCertificadoServer ($idSession, $idCertificado, $docContentB64, $tipoDoc='TF06')
1340  {
1341  try
1342  {
1343  $this->__clienteOn(self::KEYCLIENTE_FIRMA);
1344  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_FIRMA];
1345 
1346 
1347  $firmarCertificadoWSRequest = new ArrayObject();
1348  $firmarCertificadoWSRequest->append(new SoapVar($idSession, XSD_STRING, null, null,'idSession', self::$NAMESPACE_GVA));
1349  $firmarCertificadoWSRequest->append(new SoapVar($idCertificado, XSD_STRING, null, null,'idCertificado', self::$NAMESPACE_GVA));
1350  $firmarCertificadoWSRequest->append(new SoapVar($docContentB64, XSD_STRING, null, null,'documento', self::$NAMESPACE_GVA));
1351  $firmarCertificadoWSRequest->append(new SoapVar('TF06', XSD_STRING, null, null, 'firmaFormato', self::$NAMESPACE_GVA));
1352  $firmarCertificadoWSRequest->append(new SoapVar('pdf', XSD_STRING, null, null, 'formatoSubtipo', self::$NAMESPACE_GVA));//pades-ltv o pdf
1353  $miSoapRQ = new SoapVar($firmarCertificadoWSRequest, SOAP_ENC_OBJECT,null,null,'firmarCertificadoWSRequest', self::$NAMESPACE_GVA);
1354  $docFirmado = $clienteWS->firmarConCertificado($miSoapRQ);
1355 
1356  if (is_object($docFirmado))
1357  {
1358  return ($docFirmado->response);
1359  }
1360  else
1361  {
1362  return($docFirmado);
1363  }
1364  }
1365  catch (Exception $e)
1366  {
1367  $this->tratarExcepcionEstandar($e, $clienteWS);
1368  }
1369  }//firmarCertificadoServer
1370 
1371 
1372  /* ----------------------------------------------------------------------- */
1373  /* ----------------------- Fin Subpaquete de Firma ----------------------- */
1374  /* ----------------------------------------------------------------------- */
1375 
1376 
1377  /* ----------------------------------------------------------------------- */
1378  /*--------------- Subpaquete GDE (Gestor Docs. electrónicos -------------- */
1379  /* ----------------------------------------------------------------------- */
1380 
1381 
1402  public function insertarDocumentoGDE($codApp, $docContentB64, $nombreDoc, $pathDoc='', $vMetadatosENI=null, $vMetadatosPersonalizados=null)
1403  {
1404  try
1405  {
1406  $this->__clienteOn(self::KEYCLIENTE_GDE, true);
1407  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_GDE];
1408 
1409 
1410  $insertarDocumentoWSRequest = new ArrayObject();
1411  $insertarDocumentoWSRequest->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE));
1412 
1413  $peticionWSRequest = new ArrayObject();
1414  $peticionWSRequest->append(new SoapVar($docContentB64, XSD_STRING, null, null,'contenido', self::$NAMESPACE_GDE));
1415  $peticionWSRequest->append(new SoapVar($nombreDoc, XSD_STRING, null, null,'nombre', self::$NAMESPACE_GDE));
1416 
1417  if (!empty($pathDoc))
1418  {
1419  $peticionWSRequest->append(new SoapVar($pathDoc, XSD_STRING, null, null,'path', self::$NAMESPACE_GDE));
1420  }
1421 
1422  $insertarDocumentoWSRequest->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE));
1423  $miSoapRQ = new SoapVar($insertarDocumentoWSRequest, SOAP_ENC_OBJECT,null,null,'insertarDocumento', self::$NAMESPACE_GDE);
1424  $respuesta = $clienteWS->insertarDocumento($miSoapRQ);
1425 
1426  //Metadatos ENI
1427  if (is_array($vMetadatosENI))
1428  {
1429  $objMetadatosENI =$this->array2ObjectTree($vMetadatosENI);
1430  $peticionWSRequest->append(new SoapVar($objMetadatosENI, SOAP_ENC_OBJECT, null, null,'metadatosENI', self::$NAMESPACE_GDE));
1431  }
1432 
1433  //Metadatos Personalizados
1434  if (is_array($vMetadatosPersonalizados))
1435  {
1436  $objMetadatosPersonalizados = $this->array2ObjectTree($vMetadatosPersonalizados);
1437  $peticionWSRequest->append(new SoapVar($objMetadatosPersonalizados, SOAP_ENC_OBJECT, null, null,'coleccionMetadatosPersonalizados', self::$NAMESPACE_GDE));
1438  }
1439 
1440  $vRespuesta = array();//RABA0f8f9d62-08fc-4a8e-98e9-f23898075b37
1441  if (is_object($respuesta))
1442  {
1443  $vRespuesta = array
1444  (
1445  'referenciaDocumento' =>$respuesta->respuesta->referenciaDocumento,
1446  'nombre' => $respuesta->respuesta->nombre
1447  );
1448  }
1449  return($vRespuesta);
1450  }
1451  catch (Exception $e)
1452  {
1453  $this->tratarExcepcionEstandar($e, $clienteWS);
1454  }
1455  }//insertarDocumentoGDE
1456 
1457 
1458 
1469  public function obtenerDocumentoGDE($codApp, $refDoc, $parcial='1')
1470  {
1471  try
1472  {
1473  $opcionesClienteWS = array (
1474  'soap_version' => SOAP_1_1, //SOAP 1.2
1475  'user_agent' => 'WSSSoapClient',
1476  'exceptions' => true,
1477  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
1478  'trace' => self::$MYSOAPOP_TRACE
1479  );
1480 
1481  $this->__clienteOn(self::KEYCLIENTE_GDE, true, $opcionesClienteWS);
1482 
1483  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE);
1484 
1485  $obtenerDocumentoWSRequest = new ArrayObject();
1486  $obtenerDocumentoWSRequest->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE));
1487 
1488  $peticionWSRequest = new ArrayObject();
1489  $peticionWSRequest->append(new SoapVar($refDoc, XSD_STRING, null, null,'referenciaDocumento', self::$NAMESPACE_GDE));
1490  $peticionWSRequest->append(new SoapVar($parcial, XSD_STRING, null, null,'parcial', self::$NAMESPACE_GDE));
1491  $obtenerDocumentoWSRequest->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE));
1492 
1493  $miSoapRQ = new SoapVar($obtenerDocumentoWSRequest, SOAP_ENC_OBJECT,null,null,'obtenerDocumento', self::$NAMESPACE_GDE);
1494  $respuesta = $clienteWS->obtenerDocumento($miSoapRQ);
1495 
1496  $vRespuesta = array();//RABA0f8f9d62-08fc-4a8e-98e9-f23898075b37
1497  if (is_object($respuesta))
1498  {
1499  $vRespuesta = $this->objectTree2array($respuesta);
1500  }
1501  return($vRespuesta);
1502  }
1503  catch (Exception $e)
1504  {
1505  // Comprobamos si estamos ante excepcion MTOM
1506  $mensaje = $e->getMessage();
1507  $mensaje = trim(strtolower($mensaje));
1508  if ($mensaje == 'looks like we got no xml document')
1509  {
1510  $response = $clienteWS->__getLastResponse();
1511  $vRetorno = $this->tratarMTOMEstandar($response);
1512  return ($vRetorno);
1513  }
1514  else
1515  {
1516  $this->tratarExcepcionEstandar($e, $clienteWS);
1517  }
1518  }
1519  }//obtenerDocumentoGDE
1520 
1521 
1531  public function eliminarDocumentoGDE($codApp, $refDoc)
1532  {
1533  //$this->setDebugMode(true);
1534  try
1535  {
1536  $opcionesClienteWS = array (
1537  'soap_version' => SOAP_1_1, //SOAP 1.2
1538  'user_agent' => 'WSSSoapClient',
1539  'exceptions' => true,
1540  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
1541  'trace' => self::$MYSOAPOP_TRACE
1542  );
1543 
1544  $this->__clienteOn(self::KEYCLIENTE_GDE, true, $opcionesClienteWS);
1545 
1546  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE);
1547 
1548  $obtenerDocumentoWSRequest = new ArrayObject();
1549  $obtenerDocumentoWSRequest->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE));
1550 
1551  $peticionWSRequest = new ArrayObject();
1552  $peticionWSRequest->append(new SoapVar($refDoc, XSD_STRING, null, null,'referenciaDocumento', self::$NAMESPACE_GDE));
1553  $obtenerDocumentoWSRequest->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE));
1554 
1555  $miSoapRQ = new SoapVar($obtenerDocumentoWSRequest, SOAP_ENC_OBJECT,null,null,'eliminarDocumento', self::$NAMESPACE_GDE);
1556  $respuesta = $clienteWS->eliminarDocumento($miSoapRQ);
1557 
1558  $vRespuesta = array();
1559  if (is_object($respuesta))
1560  {
1561  $vRespuesta = $this->objectTree2array($respuesta);
1562  }
1563  return($vRespuesta);
1564  }
1565  catch (Exception $e)
1566  {
1567  $mensaje = $e->detail->ExcepcionWS->detalleError;
1568  $mensaje = trim(strtolower($mensaje));
1569  if (strpos($mensaje, 'ya estaba borrado')===false)
1570  {
1571  $this->tratarExcepcionEstandar($e, $clienteWS);
1572  }
1573  else
1574  {
1575  return array('correcto'=>false);
1576  }
1577  }
1578  }//eliminarDocumentoGDE
1579 
1580 
1581 
1591  public function eliminarCarpetaGDE($codApp, $path)
1592  {
1593  try
1594  {
1595  $opcionesClienteWS = array (
1596  'soap_version' => SOAP_1_1, //SOAP 1.2
1597  'user_agent' => 'WSSSoapClient',
1598  'exceptions' => true,
1599  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
1600  'trace' => self::$MYSOAPOP_TRACE
1601  );
1602 
1603  $this->__clienteOn(self::KEYCLIENTE_GDE, true, $opcionesClienteWS);
1604 
1605  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE);
1606 
1607  $obtenerDocumentoWSRequest = new ArrayObject();
1608  $obtenerDocumentoWSRequest->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE));
1609 
1610  $peticionWSRequest = new ArrayObject();
1611  $peticionWSRequest->append(new SoapVar($path, XSD_STRING, null, null,'path', self::$NAMESPACE_GDE));
1612  $obtenerDocumentoWSRequest->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE));
1613 
1614  $miSoapRQ = new SoapVar($obtenerDocumentoWSRequest, SOAP_ENC_OBJECT,null,null,'eliminarCarpeta', self::$NAMESPACE_GDE);
1615  $respuesta = $clienteWS->eliminarCarpeta($miSoapRQ);
1616 
1617  $vRespuesta = array();
1618  if (is_object($respuesta))
1619  {
1620  $vRespuesta = $this->objectTree2array($respuesta);
1621  }
1622  return($vRespuesta);
1623  }
1624  catch (Exception $e)
1625  {
1626  $this->tratarExcepcionEstandar($e, $clienteWS);
1627  }
1628  }//eliminarCarpetaGDE
1629 
1630 
1631 
1632  /* ----------------------------------------------------------------------- */
1633  /* -------------------------- Fin Subpaquete GDE ------------------------- */
1634  /* ----------------------------------------------------------------------- */
1635 
1636  /* ----------------------------------------------------------------------- */
1637  /* ---------------------------- Subpaquete SALT -------------------------- */
1638  /* ----------------------------------------------------------------------- */
1639 
1650  public function castellanoValenciano ($texto)
1651  {
1652  $opcionesClienteWS = array (
1653  'soap_version' => SOAP_1_1, //SOAP 1.2
1654  'user_agent' => 'WSSSoapClient',
1655  'exceptions' => true,
1656  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
1657  'trace' => self::$MYSOAPOP_TRACE
1658  );
1659 
1660  try
1661  {
1662  $this->__clienteOn(self::KEYCLIENTE_SALT, true, $opcionesClienteWS);
1663  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_SALT];
1664  $textoTraducido = $clienteWS->castellanoValenciano($texto);
1665  if (is_object($textoTraducido))
1666  {
1667  return ($textoTraducido->texto);
1668  }
1669  else
1670  {
1671  return ($textoTraducido);
1672  }
1673  }
1674  catch (Exception $e)
1675  {
1676  $this->tratarExcepcionEstandar($e, $clienteWS);
1677  }
1678  }//castellanoValenciano
1679 
1680 
1691  public function valencianoCastellano ($texto)
1692  {
1693  $opcionesClienteWS = array (
1694  'soap_version' => SOAP_1_1, //SOAP 1.2
1695  'user_agent' => 'WSSSoapClient',
1696  'exceptions' => true,
1697  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
1698  'trace' => self::$MYSOAPOP_TRACE
1699  );
1700 
1701  try
1702  {
1703  $this->__clienteOn(self::KEYCLIENTE_SALT, true, $opcionesClienteWS);
1704  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_SALT];
1705  $textoTraducido = $clienteWS->valencianoCastellano($texto);
1706  if (is_object($textoTraducido))
1707  {
1708  return ($textoTraducido->texto);
1709  }
1710  else
1711  {
1712  return ($textoTraducido);
1713  }
1714  }
1715  catch (Exception $e)
1716  {
1717  $this->tratarExcepcionEstandar($e, $clienteWS);
1718  }
1719  }//valencianoCastellano
1720 
1721 
1722 
1723  /* ----------------------------------------------------------------------- */
1724  /* -------------------------- Fin subpaquete SALT ------------------------ */
1725  /* ----------------------------------------------------------------------- */
1726 
1727 
1728 
1729 
1730  // --------------- Métodos propios de la clase ---------------- */
1739  private function __clienteOn($tipo, $trazabilidadPai=true, $opcionesClienteWS = null)
1740  {
1741  $vTiposCliente = array();
1742  if (!empty($tipo))
1743  {
1744  $tipo = trim(strtolower($tipo));
1745  if (array_key_exists($tipo, $this->v_clienteWS))
1746  {
1747  $vTiposCliente = array($tipo);
1748  }
1749  else
1750  {
1751  if ($this->getDebugMode())
1752  {
1753  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.' Tipo de cliente WS ('.$tipo.') no reconocido.');
1754  }
1755  throw new Exception (
1756  __CLASS__.':'.__METHOD__.'['.__FILE__.']-L'.__LINE__.'.'.
1757  'Tipo de cliente WS ('.$tipo.') no reconocido'
1758  );
1759  }
1760  }
1761 
1762  if (!is_array($opcionesClienteWS))
1763  {
1764  $opcionesClienteWS = array (
1765  'soap_version' => SOAP_1_1,
1766  'user_agent' => 'WSSSoapClient',
1767  'exceptions' => true,
1768  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
1769  'trace' => self::$MYSOAPOP_TRACE //NECESARIO PARA TRATAR MTOM
1770  );
1771  }
1772  else
1773  {
1774  $opcionesClienteWS['trace'] = self::$MYSOAPOP_TRACE; //NECESARIO PARA TRATAR MTOM
1775  }
1776 
1777  if ($this->getDebugMode())
1778  {
1779  $this->addDebugInfo("Opciones:\n ".print_r($opcionesClienteWS, true));
1780  }
1781 
1782  foreach ($vTiposCliente as $claveTipo)
1783  {
1784  if (is_object($this->v_clienteWS[$claveTipo])) continue;
1785  try
1786  {
1787  //Comprobamos accesibilidad de la URL
1788  if (ini_get('allow_url_fopen') == true)//Si tenemos acceso a allow_url_open
1789  {
1790  $opciones = array (
1791  'http' => array (
1792  'timeout' => $this->WSDLTimeOut
1793  ),
1794  'https' => array (
1795  'timeout' => $this->WSDLTimeOut
1796  ),
1797  'ssl' => array (
1798  'verify_peer' => false,
1799  'allow_self_signed' => true
1800  )
1801  );
1802 
1803  $sc = stream_context_create($opciones);
1804  $fd = fopen($this->v_wsdl[$claveTipo], 'r', false, $sc);
1805  if ($fd==false)
1806  {
1807  throw new Exception('allow_url_fopen activo. La URL '.$this->v_wsdl[$claveTipo].' no puede alcanzarse.');
1808  }
1809  fclose($fd);
1810  }
1811  /*
1812  elseif (function_exists('curl_version'))//Si tenemos acceso CURL utilizamos la extensión
1813  {
1814  if ($this->getDebugMode())
1815  {
1816  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.' allow_url_fopen NO ACTIVO');
1817  }
1818  $url = strtolower(str_replace(' ', '%20', trim($this->v_wsdl[$claveTipo])));
1819 
1820  $cd = curl_init($url);
1821  if ($cd===false)
1822  {
1823  $mensaje = "CURL. La URL $url no puede alcanzarse";
1824  curl_close($cd);
1825  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.$mensaje);
1826  throw new Exception($mensaje);
1827  }
1828 
1829  @curl_setopt($cd, CURLOPT_HEADER,true); // we want headers
1830  @curl_setopt($cd, CURLOPT_NOBODY, true); // dont need body
1831  @curl_setopt($cd, CURLOPT_RETURNTRANSFER, true);
1832  @curl_setopt($cd, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
1833  @curl_setopt($cd, CURLOPT_CONNECTTIMEOUT, 20);
1834  @curl_setopt($cd, CURLOPT_SSL_VERIFYPEER, false);
1835  @curl_setopt($cd, CURLOPT_FOLLOWLOCATION, true);
1836  @curl_setopt($cd, CURLOPT_MAXREDIRS, 10); // fairly random number, but
1837  curl_exec($cd);
1838  $codError = @curl_errno($cd);
1839  if ($codError!=0)
1840  {
1841  $mensaje = "CURL. La URL $url no puede alcanzarse. Error: [$codError]";
1842  curl_close($cd);
1843  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.$mensaje);
1844  throw new Exception($mensaje);
1845  }
1846  $httpcode = curl_getinfo($cd, CURLINFO_HTTP_CODE);
1847 
1848  curl_close($cd);
1849  if (($httpcode!=200))
1850  {
1851  $mensaje = "CURL. La URL $url no puede alcanzarse: $httpcode";
1852  curl_close($cd);
1853  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.$mensaje);
1854  throw new Exception($mensaje);
1855  }
1856  echo "CURL: La URL es accesible.";
1857  exit;
1858  }
1859  */
1860  else//No lanzamos excepción, sólo registramos la posibilidad
1861  {
1862  if ($this->getDebugMode())
1863  {
1864  $this->addDebugInfo(__CLASS__.':'.__METHOD__.'['.__FILE__.'-'.__LINE__.']'.' allow_url_fopen NO ACTIVO y Extensión CURL NO ACTIVA');
1865  }
1866  }
1867 
1868  //Si llegamos aquí no hemos podido comprobar la accesibilidad del WSDL previamente, así que saltará la excepción si no es alcanzable
1869 
1870  $clienteWS = new WSSSoapClient($this->v_wsdl[$claveTipo], $opcionesClienteWS);
1871  $clienteWS->setCertFile($this->certFile);//Certificado (sin key) PEM
1872  $clienteWS->setKeyFile($this->keyFile);//Acceso al fichero .key extraido del pk12 formato PEM
1873  $clienteWS->setPassPhrase($this->passPhrase);
1874 
1875  if (($trazabilidadPai) && is_array($this->vTrazabilidad))
1876  {
1877  $clienteWS->loadTracertPAI($this->vTrazabilidad);
1878  }
1879  $this->v_clienteWS[$claveTipo] = $clienteWS;
1880  }
1881  catch (Exception $e)
1882  {
1883  $this->tratarExcepcionEstandar($e, $clienteWS);
1884  }
1885  }//Fin foreach
1886 
1887  }// Fin __clienteOn
1888 
1889 
1890 
1891 
1899  public function __getClient($tipo)
1900  {
1901  // Si esta vacío el tipo, nada
1902  if (empty($tipo)) return null;
1903 
1904  $tipo = trim(strtolower($tipo));
1905  try
1906  {
1907  $this->__clienteOn($tipo);
1908 
1909  if (!is_object($this->v_clienteWS[$tipo]))
1910  return null;
1911  else
1912  return ($this->v_clienteWS[$tipo]);
1913  }
1914  catch (Exception $e)
1915  {
1916  throw $e;
1917  }
1918  }// Fin __getClient
1919 
1920 
1928  protected function array2ObjectTree($array)
1929  {
1930  if (!is_array($array)) return;
1931 
1932  if (is_numeric(key($array)))
1933  {
1934  foreach ($array as $key => $value)
1935  {
1936  $array[$key] = $this->array2ObjectTree($value);
1937  }
1938  return $array;
1939  }
1940  $Object = new stdClass;
1941  foreach ($array as $key => $value)
1942  {
1943  if (is_array($value))
1944  {
1945  $Object->$key = $this->array2ObjectTree($value);
1946  }
1947  else
1948  {
1949  $Object->$key = $value;
1950  }
1951  }
1952  return $Object;
1953  }//Fin array2ObjectTree
1954 
1962  protected function objectTree2array($obj)
1963  {
1964  if (is_array($obj) || is_object($obj))
1965  {
1966  $result = array();
1967  foreach ($obj as $key => $value)
1968  {
1969  $result[$key] = $this->objectTree2array($value);
1970  }
1971  return $result;
1972  }
1973  return $obj;
1974  }//Fin objectTree2array
1975 
1976 
1977 
1978  /* ------------------------------------------------------------------ */
1979  /* -------------------------- Subpaquete CSV ------------------------ */
1980  /* ------------------------------------------------------------------ */
1981 
1982 
1983  public function csv_encodeClaveAcceso($appID, $nif, $referenciaExterna, $firmante)
1984  {
1985  $claveAccesoWSRequest = new ArrayObject();
1986  $claveAccesoWSRequest->append(new SoapVar($appID, XSD_STRING, null, null,'aplicacionId'));
1987  $claveAccesoWSRequest->append(new SoapVar($nif, XSD_STRING, null, null,'nif'));
1988  $claveAccesoWSRequest->append(new SoapVar($referenciaExterna, XSD_STRING, null, null,'referenciaExterna'));
1989  $claveAccesoWSRequest->append(new SoapVar($firmante, XSD_STRING, null, null,'firmante'));
1990 
1991  return $claveAccesoWSRequest;
1992  }//csv_encodeClaveAcceso
1993 
1994  public function obtenerCodigo($appID, $nif, $referenciaExterna, $firmante,
1995  $generarBarCode=null, $tipoBarCode=null, $width=null, $height=null)
1996  // $docContentB64=null, $nombreDoc=null, $pathDoc='', $vMetadatosENInull, $vMetadatosPersonalizados=null)
1997  {
1998  try
1999  {
2000 
2001  $this->__clienteOn(self::KEYCLIENTE_CSV, true);
2002  $clienteWS = $this->__getClient(self::KEYCLIENTE_CSV);
2003  $claveAccesoWSRequest = $this->csv_encodeClaveAcceso($appID, $nif, $referenciaExterna, $firmante);
2004 
2005  $opcGeneracionWSRequest = new ArrayObject();
2006  if (!empty($generarBarCode))
2007  $opcGeneracionWSRequest->append(new SoapVar($generarBarCode, XSD_STRING, null, null,'generarBarCode'));
2008  if (!empty($tipoBarCode))
2009  $opcGeneracionWSRequest->append(new SoapVar($tipoBarCode, XSD_STRING, null, null,'tipoBarCode'));
2010  if (!empty($width))
2011  $opcGeneracionWSRequest->append(new SoapVar($width, XSD_STRING, null, null,'width'));
2012  if (!empty($height))
2013  $opcGeneracionWSRequest->append(new SoapVar($height, XSD_STRING, null, null,'height'));
2014 
2015  // Global
2016  $claveAcceso2WSRequest = new ArrayObject();
2017  $claveAcceso2WSRequest->append(new SoapVar($claveAccesoWSRequest, SOAP_ENC_OBJECT, null, null,'claveAcceso'));
2018  $claveAcceso2WSRequest->append(new SoapVar($opcGeneracionWSRequest, SOAP_ENC_OBJECT, null, null,'opcionesGeneracion'));
2019 
2020  // Realiza la solicitud
2021  $peticionWSRequest = new ArrayObject();
2022  $peticionWSRequest->append(new SoapVar($claveAcceso2WSRequest, SOAP_ENC_OBJECT,null,null,'peticion'));
2023  $miSoapRQ = new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'obtenerCSVRequest', self::$NAMESPACE_CSVGVA);
2024  $respuesta = $clienteWS->obtenerCSV($miSoapRQ);
2025 
2026 
2027  // Respuesta
2028  $vRespuesta = array();//RABA0f8f9d62-08fc-4a8e-98e9-f23898075b37
2029  if (is_object($respuesta))
2030  {
2031  $vRespuesta = array
2032  (
2033  'csv' => $respuesta->respuesta->csv,
2034  'url' => $respuesta->respuesta->url,
2035  );
2036  if (isset($respuesta->respuesta->imagenBarCode))
2037  $vRespuesta['imagenBarCode'] = $respuesta->respuesta->imagenBarCode;
2038  }
2039  return($vRespuesta);
2040  }
2041  catch (Exception $e)
2042  {
2043  $this->tratarExcepcionEstandar($e, $clienteWS);
2044  }
2045  }//obtenerCodigo
2046 
2047  public function asociarCSV($csv, $appID, $nif, $referenciaExterna, $firmante,
2048  $idRepositorio, $refDoc, $hash, $fechaCaducidad = null, $vParametros = null)
2049  {
2050  try
2051  {
2052  $this->__clienteOn(self::KEYCLIENTE_CSV, true);
2053  $clienteWS = $this->__getClient(self::KEYCLIENTE_CSV);
2054 
2055 
2056  $claveAccesoWSRequest = $this->csv_encodeClaveAcceso($appID, $nif, $referenciaExterna, $firmante);
2057 
2058  $infDocWSRequest = new ArrayObject();
2059  $infDocWSRequest->append(new SoapVar($idRepositorio, XSD_STRING, null, null,'idRepositorio'));
2060  $infDocWSRequest->append(new SoapVar($refDoc, XSD_STRING, null, null,'referenciaDocumento'));
2061  $infDocWSRequest->append(new SoapVar($hash, XSD_STRING, null, null,'hash'));
2062  if (!empty($fechaCaducidad))
2063  $infDocWSRequest->append(new SoapVar($fechaCaducidad->format(DateTime::ATOM), XSD_STRING, null, null,'fechaCaducidad'));
2064  if (is_array($vParametros)) {
2065 
2066  $parametrosVerificacion = new ArrayObject();
2067 
2068  foreach ($vParametros as $itemParametro) {
2069  $parametro = new ArrayObject();
2070  $parametro->append(new SoapVar($itemParametro['etiqueta'], XSD_STRING, null, null,'etiqueta'));
2071  $parametro->append(new SoapVar($itemParametro['ayuda'], XSD_STRING, null, null,'ayuda'));
2072  $parametro->append(new SoapVar($itemParametro['valor'], XSD_STRING, null, null,'valor'));
2073 
2074  $parametrosVerificacion->append(new SoapVar($parametro, SOAP_ENC_OBJECT, null, null,'parametro'));
2075  }
2076 
2077  $infDocWSRequest->append(new SoapVar($parametrosVerificacion, SOAP_ENC_OBJECT, null, null,'parametrosVerificacion'));
2078  }
2079 
2080  // Global
2081  $claveAcceso2WSRequest = new ArrayObject();
2082  $claveAcceso2WSRequest->append(new SoapVar($csv, XSD_STRING, null, null,'csv'));
2083  $claveAcceso2WSRequest->append(new SoapVar($claveAccesoWSRequest, SOAP_ENC_OBJECT, null, null,'claveAcceso'));
2084  $claveAcceso2WSRequest->append(new SoapVar($infDocWSRequest, SOAP_ENC_OBJECT, null, null,'informacionDocumento'));
2085 
2086 
2087 
2088  // Realiza la solicitud
2089  $peticionWSRequest = new ArrayObject();
2090  $peticionWSRequest->append(new SoapVar($claveAcceso2WSRequest, SOAP_ENC_OBJECT,null,null,'peticion'));
2091  $miSoapRQ = new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'asociarCSVRequest', self::$NAMESPACE_CSVGVA);
2092  $respuesta = $clienteWS->asociarCSV($miSoapRQ);
2093 
2094  // Respuesta
2095  $vRespuesta = array();
2096  if (is_object($respuesta))
2097  {
2098  $vRespuesta = array
2099  (
2100  'respuesta' => $respuesta->respuesta->respuesta
2101  );
2102  }
2103  return($vRespuesta);
2104  }
2105  catch (Exception $e)
2106  {
2107  $this->tratarExcepcionEstandar($e, $clienteWS);
2108  }
2109  }//asociarCSV
2110 
2111  public function invalidarCSV($csv, $appID, $nif, $referenciaExterna, $firmante)
2112  {
2113  try
2114  {
2115  $this->__clienteOn(self::KEYCLIENTE_CSV, true);
2116  $clienteWS = $this->__getClient(self::KEYCLIENTE_CSV);
2117 
2118 
2119  $claveAccesoWSRequest = $this->csv_encodeClaveAcceso($appID, $nif, $referenciaExterna, $firmante);
2120 
2121 
2122  // Global
2123  $claveAcceso2WSRequest = new ArrayObject();
2124  $claveAcceso2WSRequest->append(new SoapVar($csv, XSD_STRING, null, null,'csv'));
2125  $claveAcceso2WSRequest->append(new SoapVar($claveAccesoWSRequest, SOAP_ENC_OBJECT, null, null,'claveAcceso'));
2126 
2127 
2128 
2129  // Realiza la solicitud
2130  $peticionWSRequest = new ArrayObject();
2131  $peticionWSRequest->append(new SoapVar($claveAcceso2WSRequest, SOAP_ENC_OBJECT,null,null,'peticion'));
2132  $miSoapRQ = new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'invalidarCSVRequest', self::$NAMESPACE_CSVGVA);
2133  $respuesta = $clienteWS->invalidarCSV($miSoapRQ);
2134 
2135  // Respuesta
2136  $vRespuesta = array();//RABA0f8f9d62-08fc-4a8e-98e9-f23898075b37
2137  if (is_object($respuesta))
2138  {
2139  $vRespuesta = array
2140  (
2141  'respuesta' => $respuesta->respuesta->respuesta
2142  );
2143  }
2144  return($vRespuesta);
2145  }
2146  catch (Exception $e)
2147  {
2148  $this->tratarExcepcionEstandar($e, $clienteWS);
2149  }
2150  }//invalidarCSV
2151 
2152  public function modificarFechaCaducidadCSV($csv, $appID, $nif, $referenciaExterna, $firmante, $fechaCaducidad)
2153  {
2154  try
2155  {
2156  $this->__clienteOn(self::KEYCLIENTE_CSV, true);
2157  $clienteWS = $this->__getClient(self::KEYCLIENTE_CSV);
2158 
2159 
2160  $claveAccesoWSRequest = $this->csv_encodeClaveAcceso($appID, $nif, $referenciaExterna, $firmante);
2161 
2162 
2163  // Global
2164  $claveAcceso2WSRequest = new ArrayObject();
2165  $claveAcceso2WSRequest->append(new SoapVar($csv, XSD_STRING, null, null,'csv'));
2166  $claveAcceso2WSRequest->append(new SoapVar($claveAccesoWSRequest, SOAP_ENC_OBJECT, null, null,'claveAcceso'));
2167  $claveAcceso2WSRequest->append(new SoapVar($fechaCaducidad->format(DateTime::ATOM), XSD_STRING, null, null,'fechaCaducidad'));
2168 
2169 
2170  // Realiza la solicitud
2171  $peticionWSRequest = new ArrayObject();
2172  $peticionWSRequest->append(new SoapVar($claveAcceso2WSRequest, SOAP_ENC_OBJECT,null,null,'peticion'));
2173  $miSoapRQ = new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'modificarFechaCSVRequest', self::$NAMESPACE_CSVGVA);
2174  $respuesta = $clienteWS->modificarFechaCSV($miSoapRQ);
2175 
2176  // Respuesta
2177  $vRespuesta = array();//RABA0f8f9d62-08fc-4a8e-98e9-f23898075b37
2178  if (is_object($respuesta))
2179  {
2180  $vRespuesta = array
2181  (
2182  'respuesta' => $respuesta->respuesta->respuesta
2183  );
2184  }
2185  return($vRespuesta);
2186  }
2187  catch (Exception $e)
2188  {
2189  $this->tratarExcepcionEstandar($e, $clienteWS);
2190  }
2191  }//modificarFechaCaducidadCSV
2192 
2193 
2194 
2195  /* ----------------------------------------------------------------------- */
2196  /*--------------- Subpaquete GDE2 (Gestor Docs. electrónicos -------------- */
2197  /* ----------------------------------------------------------------------- */
2198 
2199 
2200 
2221  public function insertarDocumentoGDE2($codApp, $docContentB64, $nombreDoc, $pathDoc=null, $tipo = null, $vMetadatosENI = null, $vMetadatosPersonalizados=null, $vFirmas=null)
2222  {
2223  try
2224  {
2225  $this->__clienteOn(self::KEYCLIENTE_GDE2, true);
2226  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_GDE2];
2227 
2228  $composer = new ComposerGDE2();
2229  $peticionWSRequest = $composer->__cde__insertarDocumento_full(
2230  array(
2231  'contenido' => $docContentB64,
2232  'nombre' => $nombreDoc,
2233  'path' => $pathDoc,
2234  'tipoPersonalizado' => $tipo,
2235  'metadatosENI' => $vMetadatosENI,
2236  'coleccionMetadatosPersonalizados' => $vMetadatosPersonalizados,
2237  'firmas' => $vFirmas
2238  ), 'peticion', self::$NAMESPACE_GDE2);
2239 
2240  $insertarDocumentoWSRequest = new ArrayObject();
2241  $insertarDocumentoWSRequest->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
2242  $insertarDocumentoWSRequest->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
2243 
2244  $miSoapRQ = new SoapVar($insertarDocumentoWSRequest, SOAP_ENC_OBJECT,null,null,'insertarDocumento', self::$NAMESPACE_GDE2);
2245  $respuesta = $clienteWS->insertarDocumento($miSoapRQ);
2246 
2247  $vRespuesta = array();
2248  if (is_object($respuesta))
2249  {
2250  $vRespuesta = $this->objectTree2array($respuesta);
2251  }
2252  return($vRespuesta);
2253  }
2254  catch (Exception $e)
2255  {
2256  // Comprobamos si estamos ante excepcion MTOM
2257  $mensaje = $e->getMessage();
2258  $mensaje = trim(strtolower($mensaje));
2259  switch ($mensaje)
2260  {
2261  case 'looks like we got no xml document' :
2262  // Obtiene la respuesta
2263  $response = $clienteWS->__getLastResponse();
2264  $respuesta = $this->tratarMTOMEstandar($response);
2265  return $respuesta;
2266  break;
2267 
2268  default:
2269  $this->tratarExcepcionEstandar($e, $clienteWS);
2270  break;
2271  }
2272  }
2273  }//insertarDocumentoGDE2
2274 
2275 
2276 
2287  public function obtenerDocumentoGDE2($codApp, $refDoc, $parcial='1')
2288  {
2289  //$this->setDebugMode(true);
2290  try
2291  {
2292  $opcionesClienteWS = array (
2293  'soap_version' => SOAP_1_1, //SOAP 1.2
2294  'user_agent' => 'WSSSoapClient',
2295  'exceptions' => true,
2296  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
2297  'trace' => self::$MYSOAPOP_TRACE
2298  );
2299 
2300  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
2301  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
2302 
2303  $composer = new ComposerGDE2();
2304  $peticionWSRequest = $composer->__cde__obtenerDocumento_full(
2305  array(
2306  'referenciaDocumento' => $refDoc ,
2307  'parcial' => $parcial
2308  ), 'peticion', self::$NAMESPACE_GDE2);
2309 
2310  $obtenerDocumentoWSRequest = new ArrayObject();
2311  $obtenerDocumentoWSRequest->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
2312  $obtenerDocumentoWSRequest->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
2313 
2314  $miSoapRQ = new SoapVar($obtenerDocumentoWSRequest, SOAP_ENC_OBJECT,null,null,'obtenerDocumento', self::$NAMESPACE_GDE2);
2315  $respuesta = $clienteWS->obtenerDocumento($miSoapRQ);
2316 
2317  $vRespuesta = array();
2318  if (is_object($respuesta))
2319  {
2320  $vRespuesta = $this->objectTree2array($respuesta);
2321  }
2322  return($vRespuesta);
2323  }
2324  catch (Exception $e)
2325  {
2326  // Comprobamos si estamos ante excepcion MTOM
2327  $mensaje = $e->getMessage();
2328  $mensaje = trim(strtolower($mensaje));
2329  switch ($mensaje)
2330  {
2331  case 'looks like we got no xml document' :
2332  // Obtiene la respuesta
2333  $response = $clienteWS->__getLastResponse();
2334  // Realiza la interpretacion/sustitucion estandar de MTOM
2335  $vRetorno = $this->tratarMTOMEstandar($response);
2336  return ($vRetorno);
2337 
2338  case 'gde_documentonoexistenteexception':
2339  return array(
2340  'respuesta' => array('correcto'=>'false'),
2341  'codMotivo' => 'NOEXISTE',
2342  'motivo' => 'No existe ningún documento con la referencia '.$refDoc
2343  );
2344  break;
2345 
2346  default:
2347  $this->tratarExcepcionEstandar($e, $clienteWS);
2348  break;
2349  }
2350  }
2351  }//obtenerDocumentoGDE2
2352 
2353 
2363  public function eliminarDocumentoGDE2($codApp, $refDoc)
2364  {
2365  //$this->setDebugMode(true);
2366  try
2367  {
2368  $opcionesClienteWS = array (
2369  'soap_version' => SOAP_1_1, //SOAP 1.2
2370  'user_agent' => 'WSSSoapClient',
2371  'exceptions' => true,
2372  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
2373  'trace' => self::$MYSOAPOP_TRACE
2374  );
2375 
2376  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
2377  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
2378 
2379  $composer = new ComposerGDE2();
2380  $peticionWSRequest = $composer->__cde__eliminarDocumento_full(
2381  array(
2382  'referenciaDocumento' => $refDoc
2383  ), 'peticion', self::$NAMESPACE_GDE2);
2384 
2385  $mainWS = new ArrayObject();
2386  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
2387  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
2388 
2389  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'eliminarDocumento', self::$NAMESPACE_GDE2);
2390  $respuesta = $clienteWS->eliminarDocumento($miSoapRQ);
2391 
2392  $vRespuesta = array();
2393  if (is_object($respuesta))
2394  {
2395  $vRespuesta = $this->objectTree2array($respuesta);
2396  }
2397  return($vRespuesta);
2398  }
2399  catch (Exception $e)
2400  {
2401  // Comprobamos si estamos ante excepcion MTOM
2402  $mensaje = $e->getMessage();
2403  $mensaje = trim(strtolower($mensaje));
2404  switch ($mensaje)
2405  {
2406  case 'looks like we got no xml document' :
2407  // Obtiene la respuesta
2408  $response = $clienteWS->__getLastResponse();
2409  // Realiza la interpretacion/sustitucion estandar de MTOM
2410  $vRetorno = $this->tratarMTOMEstandar($response);
2411  return $vRetorno;
2412  break;
2413 
2414  case 'gde_gestordocumentalexception' :
2415  $mensaje = $e->detail->ExcepcionWS->detalleError;
2416  $mensaje = trim(strtolower($mensaje));
2417  if (strpos($mensaje, 'ya estaba borrado')===false)
2418  {
2419  $this->tratarExcepcionEstandar($e, $clienteWS);
2420  }
2421  else
2422  {
2423  return array(
2424  'respuesta' => array('correcto'=>'false'),
2425  'codMotivo' => 'PREBORRADO',
2426  'motivo' => 'El documento ya había sido borrado'
2427  );
2428  }
2429  break;
2430 
2431  case 'gde_documentonoexistenteexception':
2432  return array(
2433  'respuesta' => array('correcto'=>'false'),
2434  'codMotivo' => 'NOEXISTE',
2435  'motivo' => 'No existe ningún documento con la referencia '.$refDoc
2436  );
2437  break;
2438 
2439  default:
2440  $this->tratarExcepcionEstandar($e, $clienteWS);
2441  break;
2442  }
2443  }//Fin catch
2444  }//eliminarDocumentoGDE2
2445 
2446 
2447 
2455  public function asociarFirmasGDE2($codApp, $refDoc, $vFirmas)
2456  {
2457 
2458  //$this->setDebugMode(true);
2459  try
2460  {
2461  $opcionesClienteWS = array (
2462  'soap_version' => SOAP_1_1, //SOAP 1.2
2463  'user_agent' => 'WSSSoapClient',
2464  'exceptions' => true,
2465  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
2466  'trace' => self::$MYSOAPOP_TRACE
2467  );
2468 
2469  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
2470  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
2471 
2472 
2473  $composer = new ComposerGDE2();
2474  $peticionWSRequest = $composer->__cde__asociarFirmas_full(array('referenciaDocumento' => $refDoc, 'firmas' => $vFirmas), 'peticion', self::$NAMESPACE_GDE2);
2475 
2476  $mainWS = new ArrayObject();
2477  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
2478  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
2479 
2480  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'asociarFirmas', self::$NAMESPACE_GDE2);
2481  $respuesta = $clienteWS->asociarFirmas($miSoapRQ);
2482 
2483  $vRespuesta = array();
2484  if (is_object($respuesta))
2485  {
2486  $vRespuesta = $this->objectTree2array($respuesta);
2487  }
2488  return($vRespuesta);
2489  }
2490  catch (Exception $e)
2491  {
2492  // Comprobamos si estamos ante excepcion MTOM
2493  $mensaje = $e->getMessage();
2494  $mensaje = trim(strtolower($mensaje));
2495  switch ($mensaje)
2496  {
2497  case 'looks like we got no xml document' :
2498  // Obtiene la respuesta
2499  $response = $clienteWS->__getLastResponse();
2500  $respuesta = $this->tratarMTOMEstandar($response);
2501  return $respuesta;
2502  break;
2503 
2504  default:
2505  $this->tratarExcepcionEstandar($e, $clienteWS);
2506  break;
2507  }
2508  }
2509  }//asociarFirmasGDE2
2510 
2511 
2512 
2529  public function buscarDocCriterioGDE2($codApp, $filtroPath=null, $buscarInTree=null, $operacion=null, $coleccionCriterios=null)
2530  {
2531  try
2532  {
2533  $opcionesClienteWS = array (
2534  'soap_version' => SOAP_1_1, //SOAP 1.2
2535  'user_agent' => 'WSSSoapClient',
2536  'exceptions' => true,
2537  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
2538  'trace' => self::$MYSOAPOP_TRACE
2539  );
2540 
2541  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
2542  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
2543 
2544 
2545  $composer = new ComposerGDE2();
2546  $peticionWSRequest = $composer->__cde__buscarDocCriterio_full(array('filtroPath' => $filtroPath, 'buscarInTree' => $buscarInTree, 'operacion' => $operacion, 'coleccionCriterios' => $coleccionCriterios), 'peticion', self::$NAMESPACE_GDE2);
2547 
2548  $mainWS = new ArrayObject();
2549  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
2550  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
2551 
2552  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'buscarDocCriterio', self::$NAMESPACE_GDE2);
2553  $respuesta = $clienteWS->buscarDocCriterio($miSoapRQ);
2554 
2555  $vRespuesta = array();
2556  if (is_object($respuesta))
2557  {
2558  $vRespuesta = $this->objectTree2array($respuesta);
2559  }
2560  return($vRespuesta);
2561  }
2562  catch (Exception $e)
2563  {
2564  // Comprobamos si estamos ante excepcion MTOM
2565  $mensaje = $e->getMessage();
2566  $mensaje = trim(strtolower($mensaje));
2567  switch ($mensaje)
2568  {
2569  case 'looks like we got no xml document' :
2570  // Obtiene la respuesta
2571  $response = $clienteWS->__getLastResponse();
2572  $respuesta = $this->tratarMTOMEstandar($response);
2573  return $respuesta;
2574  break;
2575 
2576  default:
2577  $this->tratarExcepcionEstandar($e, $clienteWS);
2578  break;
2579  }
2580  }
2581  }//buscarDocCriterioGDE2
2582 
2583 
2600  public function buscarDocCriterioPaginadoGDE2($codApp, $registrosPagina, $pagina, $filtroPath=null, $buscarInTree=null, $operacion=null, $coleccionCriterios=null) {
2601  try
2602  {
2603  $opcionesClienteWS = array (
2604  'soap_version' => SOAP_1_1, //SOAP 1.2
2605  'user_agent' => 'WSSSoapClient',
2606  'exceptions' => true,
2607  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
2608  'trace' => self::$MYSOAPOP_TRACE
2609  );
2610 
2611  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
2612  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
2613 
2614 
2615  $composer = new ComposerGDE2();
2616  $peticionWSRequest = $composer->__cde__buscarDocCriterioPaginado_full(array('paginacion' => array('registrosPagina' => $registrosPagina, 'pagina' => $pagina), 'filtroPath' => $filtroPath, 'buscarInTree' => $buscarInTree, 'operacion' => $operacion, 'coleccionCriterios' => $coleccionCriterios), 'peticion', self::$NAMESPACE_GDE2);
2617 
2618  $mainWS = new ArrayObject();
2619  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
2620  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
2621 
2622  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'buscarDocCriterioPaginado', self::$NAMESPACE_GDE2);
2623  $respuesta = $clienteWS->buscarDocCriterioPaginado($miSoapRQ);
2624 
2625  $vRespuesta = array();
2626  if (is_object($respuesta))
2627  {
2628  $vRespuesta = $this->objectTree2array($respuesta);
2629  }
2630  return($vRespuesta);
2631  }
2632  catch (Exception $e)
2633  {
2634  // Comprobamos si estamos ante excepcion MTOM
2635  $mensaje = $e->getMessage();
2636  $mensaje = trim(strtolower($mensaje));
2637  switch ($mensaje)
2638  {
2639  case 'looks like we got no xml document' :
2640  // Obtiene la respuesta
2641  $response = $clienteWS->__getLastResponse();
2642  $respuesta = $this->tratarMTOMEstandar($response);
2643  return $respuesta;
2644  break;
2645 
2646  default:
2647  $this->tratarExcepcionEstandar($e, $clienteWS);
2648  break;
2649  }
2650  }
2651  }//buscarDocCriterioPaginadoGDE2
2652 
2653 
2654 
2663  public function crearCarpetaGDE2($codApp, $path, $tipo=null, $metadatosExpedienteEni=null, $coleccionMetadatosPersonalizados=null)
2664  {
2665  try
2666  {
2667  $opcionesClienteWS = array (
2668  'soap_version' => SOAP_1_1, //SOAP 1.2
2669  'user_agent' => 'WSSSoapClient',
2670  'exceptions' => true,
2671  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
2672  'trace' => self::$MYSOAPOP_TRACE
2673  );
2674 
2675  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
2676  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
2677 
2678 
2679  $composer = new ComposerGDE2();
2680  $peticionWSRequest = $composer->__cde__crearCarpeta_full(
2681  array(
2682  'path' => $path,
2683  'tipoPersonalizado' => $tipo,
2684  'metadatosExpedienteEni' => $metadatosExpedienteEni,
2685  'coleccionMetadatosPersonalizados' => $coleccionMetadatosPersonalizados
2686  ), 'peticion', self::$NAMESPACE_GDE2);
2687 
2688  $mainWS = new ArrayObject();
2689  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
2690  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
2691 
2692  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'crearCarpeta', self::$NAMESPACE_GDE2);
2693  $respuesta = $clienteWS->crearCarpeta($miSoapRQ);
2694 
2695  $vRespuesta = array();
2696  if (is_object($respuesta))
2697  {
2698  $vRespuesta = $this->objectTree2array($respuesta);
2699  }
2700  return($vRespuesta);
2701  }
2702  catch (Exception $e)
2703  {
2704  // Comprobamos si estamos ante excepcion MTOM
2705  $mensaje = $e->getMessage();
2706  $mensaje = trim(strtolower($mensaje));
2707  switch ($mensaje)
2708  {
2709  case 'looks like we got no xml document' :
2710  // Obtiene la respuesta
2711  $response = $clienteWS->__getLastResponse();
2712  $respuesta = $this->tratarMTOMEstandar($response);
2713  return $respuesta;
2714  break;
2715 
2716  default:
2717  $this->tratarExcepcionEstandar($e, $clienteWS);
2718  break;
2719  }
2720  }
2721  }//crearCarpetaGDE2
2722 
2723 
2730  public function eliminarCarpetaGDE2($codApp, $path)
2731  {
2732  //$this->setDebugMode(true);
2733  try
2734  {
2735  $opcionesClienteWS = array (
2736  'soap_version' => SOAP_1_1, //SOAP 1.2
2737  'user_agent' => 'WSSSoapClient',
2738  'exceptions' => true,
2739  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
2740  'trace' => self::$MYSOAPOP_TRACE
2741  );
2742 
2743  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
2744  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
2745 
2746 
2747  $composer = new ComposerGDE2();
2748  $peticionWSRequest = $composer->__cde__eliminarCarpeta_full(
2749  array(
2750  'path' => $path
2751  ), 'peticion', self::$NAMESPACE_GDE2);
2752 
2753  $obtenerDocumentoWSRequest = new ArrayObject();
2754  $obtenerDocumentoWSRequest->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
2755  $obtenerDocumentoWSRequest->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
2756 
2757  $miSoapRQ = new SoapVar($obtenerDocumentoWSRequest, SOAP_ENC_OBJECT,null,null,'eliminarCarpeta', self::$NAMESPACE_GDE2);
2758  $respuesta = $clienteWS->eliminarCarpeta($miSoapRQ);
2759 
2760  $vRespuesta = array();
2761  if (is_object($respuesta))
2762  {
2763  $vRespuesta = $this->objectTree2array($respuesta);
2764  }
2765  return($vRespuesta);
2766  }
2767  catch (Exception $e)
2768  {
2769  // Comprobamos si estamos ante excepcion MTOM
2770  $mensaje = $e->getMessage();
2771  $mensaje = trim(strtolower($mensaje));
2772  switch ($mensaje)
2773  {
2774  case 'looks like we got no xml document' :
2775  // Obtiene la respuesta
2776  $response = $clienteWS->__getLastResponse();
2777  $respuesta = $this->tratarMTOMEstandar($response);
2778  return $respuesta;
2779  break;
2780 
2781  default:
2782  $this->tratarExcepcionEstandar($e, $clienteWS);
2783  break;
2784  }
2785  }
2786  }//eliminarCarpetaGDE2
2787 
2788 
2789 
2797  public function empaquetarDocumentoENIGDE2($codApp, $contenido, $vMetadatosEni, $vFirmas) {
2798 
2799  //$this->setDebugMode(true);
2800  try
2801  {
2802  $opcionesClienteWS = array (
2803  'soap_version' => SOAP_1_1, //SOAP 1.2
2804  'user_agent' => 'WSSSoapClient',
2805  'exceptions' => true,
2806  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
2807  'trace' => self::$MYSOAPOP_TRACE
2808  );
2809 
2810  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
2811  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
2812 
2813 
2814  $composer = new ComposerGDE2();
2815  $peticionWSRequest = $composer->__cde__empaquetarDocumentoENI_full(array('contenido' => $contenido, 'metadatosENI' => $vMetadatosEni, 'firmas' => $vFirmas), 'peticion', self::$NAMESPACE_GDE2);
2816 
2817  $mainWS = new ArrayObject();
2818  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
2819  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
2820 
2821 
2822  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'empaquetarDocumentoENI', self::$NAMESPACE_GDE2);
2823  $respuesta = $clienteWS->empaquetarDocumentoENI($miSoapRQ);
2824 
2825  $vRespuesta = array();
2826  if (is_object($respuesta))
2827  {
2828  $vRespuesta = $this->objectTree2array($respuesta);
2829  }
2830  return($vRespuesta);
2831  }
2832  catch (Exception $e)
2833  {
2834  // Comprobamos si estamos ante excepcion MTOM
2835  $mensaje = $e->getMessage();
2836  $mensaje = trim(strtolower($mensaje));
2837  switch ($mensaje)
2838  {
2839  case 'looks like we got no xml document' :
2840  // Obtiene la respuesta
2841  $response = $clienteWS->__getLastResponse();
2842  $respuesta = $this->tratarMTOMEstandar($response);
2843  return $respuesta;
2844  break;
2845 
2846  default:
2847  $this->tratarExcepcionEstandar($e, $clienteWS);
2848  break;
2849  }
2850  }
2851  }//empaquetarDocumentoENIGDE2
2852 
2853 
2861  public function establecerMetadatoCarpetasPersonalizadosGDE2($codApp, $path, $vColMetadatosPers) {
2862  try
2863  {
2864  $opcionesClienteWS = array (
2865  'soap_version' => SOAP_1_1, //SOAP 1.2
2866  'user_agent' => 'WSSSoapClient',
2867  'exceptions' => true,
2868  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
2869  'trace' => self::$MYSOAPOP_TRACE
2870  );
2871 
2872  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
2873  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
2874 
2875 
2876  $composer = new ComposerGDE2();
2877  $peticionWSRequest = $composer->__cde__establecerMetadatoCarpetasPersonalizados_full(array('path' => $path, 'coleccionMetadatosPersonalizados' => $vColMetadatosPers), 'peticion', self::$NAMESPACE_GDE2);
2878 
2879  $mainWS = new ArrayObject();
2880  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
2881  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
2882 
2883 
2884  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'establecerMetadatoCarpetasPersonalizados', self::$NAMESPACE_GDE2);
2885  $respuesta = $clienteWS->establecerMetadatoCarpetasPersonalizados($miSoapRQ);
2886 
2887  $vRespuesta = array();
2888  if (is_object($respuesta))
2889  {
2890  $vRespuesta = $this->objectTree2array($respuesta);
2891  }
2892  return($vRespuesta);
2893  }
2894  catch (Exception $e)
2895  {
2896  // Comprobamos si estamos ante excepcion MTOM
2897  $mensaje = $e->getMessage();
2898  $mensaje = trim(strtolower($mensaje));
2899  switch ($mensaje)
2900  {
2901  case 'looks like we got no xml document' :
2902  // Obtiene la respuesta
2903  $response = $clienteWS->__getLastResponse();
2904  $respuesta = $this->tratarMTOMEstandar($response);
2905  return $respuesta;
2906  break;
2907 
2908  default:
2909  $this->tratarExcepcionEstandar($e, $clienteWS);
2910  break;
2911  }
2912  }
2913  }//establecerMetadatoCarpetasPersonalizadosGDE2
2914 
2921  public function establecerMetadatosCarpetaExpedienteENIGDE2($codApp, $path, $vMetadatosExpedienteEni) {
2922 
2923  //$this->setDebugMode(true);
2924  try
2925  {
2926  $opcionesClienteWS = array (
2927  'soap_version' => SOAP_1_1, //SOAP 1.2
2928  'user_agent' => 'WSSSoapClient',
2929  'exceptions' => true,
2930  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
2931  'trace' => self::$MYSOAPOP_TRACE
2932  );
2933 
2934  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
2935  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
2936 
2937 
2938  $composer = new ComposerGDE2();
2939  $peticionWSRequest = $composer->__cde__establecerMetadatosCarpetaExpedienteENI_full(array('path' => $path, 'metadatosExpedienteEni' => $vMetadatosExpedienteEni), 'peticion', self::$NAMESPACE_GDE2);
2940 
2941  $mainWS = new ArrayObject();
2942  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
2943  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
2944 
2945 
2946  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'establecerMetadatosCarpetaExpedienteENI', self::$NAMESPACE_GDE2);
2947  $respuesta = $clienteWS->establecerMetadatosCarpetaExpedienteENI($miSoapRQ);
2948 
2949  $vRespuesta = array();
2950  if (is_object($respuesta))
2951  {
2952  $vRespuesta = $this->objectTree2array($respuesta);
2953  }
2954  return($vRespuesta);
2955  }
2956  catch (Exception $e)
2957  {
2958  // Comprobamos si estamos ante excepcion MTOM
2959  $mensaje = $e->getMessage();
2960  $mensaje = trim(strtolower($mensaje));
2961  switch ($mensaje)
2962  {
2963  case 'looks like we got no xml document' :
2964  // Obtiene la respuesta
2965  $response = $clienteWS->__getLastResponse();
2966  $respuesta = $this->tratarMTOMEstandar($response);
2967  return $respuesta;
2968  break;
2969 
2970  default:
2971  $this->tratarExcepcionEstandar($e, $clienteWS);
2972  break;
2973  }
2974  }
2975  }//establecerMetadatosCarpetaExpedienteENIGDE2
2976 
2977 
2987  public function establecerMetadatosENIGDE2($codApp, $refDoc, $vMetadatosEni)
2988  {
2989  //$this->setDebugMode(true);
2990  try
2991  {
2992  $opcionesClienteWS = array (
2993  'soap_version' => SOAP_1_1, //SOAP 1.2
2994  'user_agent' => 'WSSSoapClient',
2995  'exceptions' => true,
2996  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
2997  'trace' => self::$MYSOAPOP_TRACE
2998  );
2999 
3000  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
3001  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
3002 
3003 
3004  $composer = new ComposerGDE2();
3005  $peticionWSRequest = $composer->__cde__establecerMetadatosENI_full(array('referenciaDocumento' => $refDoc, 'metadatosENI' => $vMetadatosEni), 'peticion', self::$NAMESPACE_GDE2);
3006 
3007  $mainWS = new ArrayObject();
3008  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
3009  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
3010 
3011 
3012  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'establecerMetadatosENI', self::$NAMESPACE_GDE2);
3013  $respuesta = $clienteWS->establecerMetadatosENI($miSoapRQ);
3014 
3015  $vRespuesta = array();
3016  if (is_object($respuesta))
3017  {
3018  $vRespuesta = $this->objectTree2array($respuesta);
3019  }
3020  return($vRespuesta);
3021  }
3022  catch (Exception $e)
3023  {
3024  // Comprobamos si estamos ante excepcion MTOM
3025  $mensaje = $e->getMessage();
3026  $mensaje = trim(strtolower($mensaje));
3027  switch ($mensaje)
3028  {
3029  case 'looks like we got no xml document' :
3030  // Obtiene la respuesta
3031  $response = $clienteWS->__getLastResponse();
3032  $respuesta = $this->tratarMTOMEstandar($response);
3033  return $respuesta;
3034  break;
3035 
3036  default:
3037  $this->tratarExcepcionEstandar($e, $clienteWS);
3038  break;
3039  }
3040  }
3041  }//establecerMetadatosENIGDE2
3042 
3043 
3050  public function establecerMetadatosPersonalizadosGDE2($codApp, $refDoc, $coleccionMetadatosPersonalizados)
3051  {
3052  try
3053  {
3054  $opcionesClienteWS = array (
3055  'soap_version' => SOAP_1_1, //SOAP 1.2
3056  'user_agent' => 'WSSSoapClient',
3057  'exceptions' => true,
3058  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3059  'trace' => self::$MYSOAPOP_TRACE
3060  );
3061 
3062  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
3063  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
3064 
3065 
3066  $composer = new ComposerGDE2();
3067  $peticionWSRequest = $composer->__cde__establecerMetadatosPersonalizados_full(array('referenciaDocumento' => $refDoc, 'coleccionMetadatosPersonalizados' => $coleccionMetadatosPersonalizados), 'peticion', self::$NAMESPACE_GDE2);
3068 
3069  $mainWS = new ArrayObject();
3070  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
3071  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
3072 
3073 
3074  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'establecerMetadatosPersonalizados', self::$NAMESPACE_GDE2);
3075  $respuesta = $clienteWS->establecerMetadatosPersonalizados($miSoapRQ);
3076 
3077  $vRespuesta = array();
3078  if (is_object($respuesta))
3079  {
3080  $vRespuesta = $this->objectTree2array($respuesta);
3081  }
3082  return($vRespuesta);
3083  }
3084  catch (Exception $e)
3085  {
3086  // Comprobamos si estamos ante excepcion MTOM
3087  $mensaje = $e->getMessage();
3088  $mensaje = trim(strtolower($mensaje));
3089  switch ($mensaje)
3090  {
3091  case 'looks like we got no xml document' :
3092  // Obtiene la respuesta
3093  $response = $clienteWS->__getLastResponse();
3094  $respuesta = $this->tratarMTOMEstandar($response);
3095  return $respuesta;
3096  break;
3097 
3098  default:
3099  $this->tratarExcepcionEstandar($e, $clienteWS);
3100  break;
3101  }
3102  }
3103  }//establecerMetadatosPersonalizadosGDE2
3104 
3105 
3110  public function generarIdentificadorENIGDE2($codApp)
3111  {
3112 
3113  //$this->setDebugMode(true);
3114  try
3115  {
3116  $opcionesClienteWS = array (
3117  'soap_version' => SOAP_1_1, //SOAP 1.2
3118  'user_agent' => 'WSSSoapClient',
3119  'exceptions' => true,
3120  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3121  'trace' => self::$MYSOAPOP_TRACE
3122  );
3123 
3124  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
3125  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
3126 
3127  $mainWS = new ArrayObject();
3128  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
3129 
3130  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'generarIdentificadorENI', self::$NAMESPACE_GDE2);
3131  $respuesta = $clienteWS->generarIdentificadorENI($miSoapRQ);
3132 
3133  $vRespuesta = array();
3134  if (is_object($respuesta))
3135  {
3136  $vRespuesta = $this->objectTree2array($respuesta);
3137  }
3138  return($vRespuesta);
3139  }
3140  catch (Exception $e)
3141  {
3142  // Comprobamos si estamos ante excepcion MTOM
3143  $mensaje = $e->getMessage();
3144  $mensaje = trim(strtolower($mensaje));
3145  switch ($mensaje)
3146  {
3147  case 'looks like we got no xml document' :
3148  // Obtiene la respuesta
3149  $response = $clienteWS->__getLastResponse();
3150  $respuesta = $this->tratarMTOMEstandar($response);
3151  return $respuesta;
3152  break;
3153 
3154  default:
3155  $this->tratarExcepcionEstandar($e, $clienteWS);
3156  break;
3157  }
3158  }
3159  }//generarIdentificadorENIGDE2
3160 
3161 
3167  public function generarTokenGDE2($codApp, $vRefDoc)
3168  {
3169  //$this->setDebugMode(true);
3170  try
3171  {
3172  $opcionesClienteWS = array (
3173  'soap_version' => SOAP_1_1, //SOAP 1.2
3174  'user_agent' => 'WSSSoapClient',
3175  'exceptions' => true,
3176  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3177  'trace' => self::$MYSOAPOP_TRACE
3178  );
3179 
3180  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
3181  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
3182 
3183  $composer = new ComposerGDE2();
3184  $peticionWSRequest = $composer->__cde__generarToken_full(array('referenciaDocumento' => $vRefDoc), 'peticion', self::$NAMESPACE_GDE2);
3185 
3186  $obtenerDocumentoWSRequest = new ArrayObject();
3187  $obtenerDocumentoWSRequest->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
3188  $obtenerDocumentoWSRequest->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
3189 
3190  $miSoapRQ = new SoapVar($obtenerDocumentoWSRequest, SOAP_ENC_OBJECT,null,null,'generarToken', self::$NAMESPACE_GDE2);
3191  $respuesta = $clienteWS->generarToken($miSoapRQ);
3192 
3193 
3194  $vRespuesta = array();
3195  if (is_object($respuesta))
3196  {
3197  $vRespuesta = $this->objectTree2array($respuesta);
3198  }
3199  return($vRespuesta);
3200  }
3201  catch (Exception $e)
3202  {
3203  // Comprobamos si estamos ante excepcion MTOM
3204  $mensaje = $e->getMessage();
3205  $mensaje = trim(strtolower($mensaje));
3206  switch ($mensaje)
3207  {
3208  case 'looks like we got no xml document' :
3209  // Obtiene la respuesta
3210  $response = $clienteWS->__getLastResponse();
3211  $respuesta = $this->tratarMTOMEstandar($response);
3212  return $respuesta;
3213  break;
3214 
3215  default:
3216  $this->tratarExcepcionEstandar($e, $clienteWS);
3217  break;
3218  }
3219  }
3220  }//generarTokenGDE2
3221 
3222 
3236  public function insertarDocumentoENIGDE2($codApp, $docContentB64, $nombreDoc, $pathDoc=null, $tipo=null, $vMetaENI=null, $vMetaPers=null, $vFirmas=null)
3237  {
3238  try
3239  {
3240  $this->__clienteOn(self::KEYCLIENTE_GDE2, true);
3241  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_GDE2];
3242 
3243  $composer = new ComposerGDE2();
3244  $peticionWSRequest = $composer->__cde__insertarDocumentoENI_full(array('documentoENI' => $docContentB64, 'nombre' => $nombreDoc,
3245  'path' => $pathDoc, 'tipoPersonalizado' => $tipo, 'metadatosENI' => $vMetaENI, 'coleccionMetadatosPersonalizados' => $vMetaPers, 'firmas' => $vFirmas), 'peticion', self::$NAMESPACE_GDE2);
3246 
3247  $mainWS = new ArrayObject();
3248  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
3249  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
3250 
3251  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'insertarDocumentoENI', self::$NAMESPACE_GDE2);
3252  $respuesta = $clienteWS->insertarDocumentoENI($miSoapRQ);
3253 
3254 
3255  $vRespuesta = array();
3256  if (is_object($respuesta))
3257  {
3258  $vRespuesta = array
3259  (
3260  'referenciaDocumento' =>$respuesta->respuesta->referenciaDocumento,
3261  'nombre' => $respuesta->respuesta->nombre
3262  );
3263  }
3264  return($vRespuesta);
3265  }
3266  catch (Exception $e)
3267  {
3268  // Comprobamos si estamos ante excepcion MTOM
3269  $mensaje = $e->getMessage();
3270  $mensaje = trim(strtolower($mensaje));
3271  switch ($mensaje)
3272  {
3273  case 'looks like we got no xml document' :
3274  // Obtiene la respuesta
3275  $response = $clienteWS->__getLastResponse();
3276  $respuesta = $this->tratarMTOMEstandar($response);
3277  return $respuesta;
3278  break;
3279 
3280  default:
3281  $this->tratarExcepcionEstandar($e, $clienteWS);
3282  break;
3283  }
3284  }
3285  }//insertarDocumentoENIGDE2
3286 
3287 
3294  public function obtenerDocumentoENIGDE2($codApp, $refDoc)
3295  {
3296  //$this->setDebugMode(true);
3297  try
3298  {
3299  $opcionesClienteWS = array (
3300  'soap_version' => SOAP_1_1, //SOAP 1.2
3301  'user_agent' => 'WSSSoapClient',
3302  'exceptions' => true,
3303  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3304  'trace' => self::$MYSOAPOP_TRACE
3305  );
3306 
3307  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
3308  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
3309 
3310  $composer = new ComposerGDE2();
3311  $peticionWSRequest = $composer->__cde__obtenerDocumentoENI_full(
3312  array(
3313  'referenciaDocumento' => $refDoc
3314  ), 'peticion', self::$NAMESPACE_GDE2);
3315 
3316  $mainWS = new ArrayObject();
3317  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
3318  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
3319 
3320  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'obtenerDocumentoENI', self::$NAMESPACE_GDE2);
3321  $respuesta = $clienteWS->obtenerDocumentoENI($miSoapRQ);
3322 
3323  $vRespuesta = array();
3324  if (is_object($respuesta))
3325  {
3326  $vRespuesta = $this->objectTree2array($respuesta);
3327  }
3328  return($vRespuesta);
3329  }
3330  catch (Exception $e)
3331  {
3332  // Comprobamos si estamos ante excepcion MTOM
3333  $mensaje = $e->getMessage();
3334  $mensaje = trim(strtolower($mensaje));
3335  switch ($mensaje)
3336  {
3337  case 'looks like we got no xml document' :
3338  // Obtiene la respuesta
3339  $response = $clienteWS->__getLastResponse();
3340  $respuesta = $this->tratarMTOMEstandar($response);
3341  return $respuesta;
3342  break;
3343 
3344  default:
3345  $this->tratarExcepcionEstandar($e, $clienteWS);
3346  break;
3347  }
3348  }
3349  }//obtenerDocumentoENIGDE2
3350 
3351 
3367  public function obtenerExpedienteENIGDE2($codApp, $refDoc, $vMetadatosExpedienteEni, $idCertificadoSafe = null, $idSesionSafe = null)
3368  {
3369  //$this->setDebugMode(true);
3370  try
3371  {
3372  $opcionesClienteWS = array (
3373  'soap_version' => SOAP_1_1, //SOAP 1.2
3374  'user_agent' => 'WSSSoapClient',
3375  'exceptions' => true,
3376  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3377  'trace' => self::$MYSOAPOP_TRACE
3378  );
3379 
3380  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
3381  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
3382 
3383  $composer = new ComposerGDE2();
3384  $peticionWSRequest = $composer->__cde__obtenerExpedienteENI_full(array('referenciaDocumento' => $refDoc, 'datosCertificado' => array('idCertificadoSafe' => $idCertificadoSafe, 'idSesionSafe' => $idSesionSafe), 'metadatosExpedienteEni' => $vMetadatosExpedienteEni), 'peticion', self::$NAMESPACE_GDE2);
3385 
3386  $mainWS = new ArrayObject();
3387  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
3388  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
3389 
3390  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'obtenerExpedienteENI', self::$NAMESPACE_GDE2);
3391  $respuesta = $clienteWS->obtenerExpedienteENI($miSoapRQ);
3392 
3393  $vRespuesta = array();
3394  if (is_object($respuesta))
3395  {
3396  $vRespuesta = $this->objectTree2array($respuesta);
3397  }
3398  return($vRespuesta);
3399  }
3400  catch (Exception $e)
3401  {
3402  // Comprobamos si estamos ante excepcion MTOM
3403  $mensaje = $e->getMessage();
3404  $mensaje = trim(strtolower($mensaje));
3405  switch ($mensaje)
3406  {
3407  case 'looks like we got no xml document' :
3408  // Obtiene la respuesta
3409  $response = $clienteWS->__getLastResponse();
3410  $respuesta = $this->tratarMTOMEstandar($response);
3411  return $respuesta;
3412  break;
3413 
3414  default:
3415  $this->tratarExcepcionEstandar($e, $clienteWS);
3416  break;
3417  }
3418  }
3419  }//obtenerExpedienteENIGDE2
3420 
3421 
3430  public function obtenerExpedienteENIdeCarpetaGDE2($codApp, $path, $idCertificadoSafe = null, $idSesionSafe = null)
3431  {
3432  //$this->setDebugMode(true);
3433  try
3434  {
3435  $opcionesClienteWS = array (
3436  'soap_version' => SOAP_1_1, //SOAP 1.2
3437  'user_agent' => 'WSSSoapClient',
3438  'exceptions' => true,
3439  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3440  'trace' => self::$MYSOAPOP_TRACE
3441  );
3442 
3443  $this->__clienteOn(self::KEYCLIENTE_GDE2, true, $opcionesClienteWS);
3444  $clienteWS = $this->__getClient(self::KEYCLIENTE_GDE2);
3445 
3446 
3447  $composer = new ComposerGDE2();
3448  $vDataPeticion = array('path' => $path);
3449  if (!is_null($idCertificadoSafe) && !is_null($idSesionSafe)) {
3450  $vDataPeticion = array('path' => $path, 'datosCertificado' => array('idCertificadoSafe' => $idCertificadoSafe, 'idSesionSafe' => $idSesionSafe));
3451  }
3452  $peticionWSRequest = $composer->__cde__obtenerExpedienteENIdeCarpeta_full($vDataPeticion, 'peticion', self::$NAMESPACE_GDE2);
3453 
3454  $mainWS = new ArrayObject();
3455  $mainWS->append(new SoapVar($codApp, XSD_STRING, null, null,'codigoAplicacion', self::$NAMESPACE_GDE2));
3456  $mainWS->append(new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,'peticion', self::$NAMESPACE_GDE2));
3457 
3458  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null,'obtenerExpedienteENIdeCarpeta', self::$NAMESPACE_GDE2);
3459  $respuesta = $clienteWS->obtenerExpedienteENIdeCarpeta($miSoapRQ);
3460 
3461  $vRespuesta = array();
3462  if (is_object($respuesta))
3463  {
3464  $vRespuesta = $this->objectTree2array($respuesta);
3465  }
3466  return($vRespuesta);
3467  }
3468  catch (Exception $e)
3469  {
3470  // Comprobamos si estamos ante excepcion MTOM
3471  $mensaje = $e->getMessage();
3472  $mensaje = trim(strtolower($mensaje));
3473  switch ($mensaje)
3474  {
3475  case 'looks like we got no xml document' :
3476  // Obtiene la respuesta
3477  $response = $clienteWS->__getLastResponse();
3478  $respuesta = $this->tratarMTOMEstandar($response);
3479  return $respuesta;
3480  break;
3481 
3482  default:
3483  $this->tratarExcepcionEstandar($e, $clienteWS);
3484  break;
3485  }
3486  }
3487  }//obtenerExpedienteENIdeCarpetaGDE2
3488 
3489 
3490 
3491  /* ----------------------------------------------------------------------- */
3492  /* ------------------------ Fin Subpaquete GDE 2 ------------------------- */
3493  /* ----------------------------------------------------------------------- */
3494 
3495 
3496  /* -------------------------------------------------------------------------- */
3497  /* -------------------------- Subpaquete PORTAFIRMAS ------------------------ */
3498  /* -------------------------------------------------------------------------- */
3499 
3511  private function pf_doAuth($username, $password, $fieldName, $ns) {
3512  $oAux = new authentication();
3513  $oAux->setUserName($username);
3514  $oAux->setPassword($password);
3515  $authWS = $oAux->toSoap($fieldName, $ns);
3516 
3517  $mainWS = new ArrayObject();
3518  $mainWS->append(new SoapVar($authWS, SOAP_ENC_OBJECT,null,null, $fieldName, $ns));
3519  return $mainWS;
3520  }
3521 
3532  public function pf_downloadDocument($username, $password, $documentId)
3533  {
3534  try
3535  {
3536  $opcionesClienteWS = array (
3537  'soap_version' => SOAP_1_1, //SOAP 1.2
3538  'user_agent' => 'WSSSoapClient',
3539  'exceptions' => true,
3540  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3541  'trace' => self::$MYSOAPOP_TRACE
3542  );
3543 
3544  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
3545  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
3546 
3547  // Nivel de peticion
3548  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
3549  $mainWS->append(new SoapVar($documentId, XSD_STRING, null, null,'documentId', self::$NAMESPACE_PF));
3550 
3551  // Realiza la peticion
3552  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'downloadDocument', self::$NAMESPACE_PF);
3553  $respuesta = $clienteWS->downloadDocument($miSoapRQ);
3554 
3555  $vRespuesta = array();
3556  if (is_object($respuesta))
3557  {
3558  $vRespuesta = $this->objectTree2array($respuesta);
3559  }
3560  return($vRespuesta);
3561  }
3562  catch (Exception $e)
3563  {
3564  // Comprobamos si estamos ante excepcion MTOM
3565  $mensaje = $e->getMessage();
3566  $mensaje = trim(strtolower($mensaje));
3567  if ($mensaje == 'looks like we got no xml document')
3568  {
3569  // Obtiene la respuesta
3570  $response = $clienteWS->__getLastResponse();
3571 
3572  // Realiza la interpretacion/sustitucion estandar de MTOM
3573  //$vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'downloadDocumentResponse');
3574  $vRetorno = $this->tratarMTOMEstandar($response);
3575 
3576  $vRetorno['documentB64'] = $vRetorno['documentBinary'];
3577  $vRetorno['documentBinary'] = base64_decode($vRetorno['documentBinary']);
3578  return ($vRetorno);
3579  }
3580  else
3581  {
3582  $this->tratarExcepcionEstandar($e, $clienteWS);
3583  }
3584  }
3585  }//pf_downloadDocument
3586 
3587 
3598  public function pf_downloadSign($username, $password, $documentId) {
3599  try
3600  {
3601  $opcionesClienteWS = array (
3602  'soap_version' => SOAP_1_1, //SOAP 1.2
3603  'user_agent' => 'WSSSoapClient',
3604  'exceptions' => true,
3605  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3606  'trace' => self::$MYSOAPOP_TRACE
3607  );
3608 
3609  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
3610  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
3611 
3612  // Nivel de peticion
3613  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
3614  $mainWS->append(new SoapVar($documentId, XSD_STRING, null, null,'documentId', self::$NAMESPACE_PF));
3615 
3616  // Realiza la peticion
3617  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'downloadSign', self::$NAMESPACE_PF);
3618  $respuesta = $clienteWS->downloadSign($miSoapRQ);
3619 
3620  $vRespuesta = array();
3621  if (is_object($respuesta))
3622  {
3623  $vRespuesta = $this->objectTree2array($respuesta);
3624  }
3625  return($vRespuesta);
3626  }
3627  catch (Exception $e)
3628  {
3629  // Comprobamos si estamos ante excepcion MTOM
3630  $mensaje = $e->getMessage();
3631  $mensaje = trim(strtolower($mensaje));
3632  if ($mensaje == 'looks like we got no xml document')
3633  {
3634  // Obtiene la respuesta
3635  $response = $clienteWS->__getLastResponse();
3636 
3637  // Realiza la interpretacion/sustitucion estandar de MTOM
3638  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'downloadSignResponse');
3639  if (isset($vRetorno['signature']))
3640  {
3641  $vRetorno['signature']['contentB64'] = $vRetorno['signature']['content'];
3642  $vRetorno['signature']['content'] = base64_decode($vRetorno['signature']['content']);
3643  }
3644  return ($vRetorno);
3645  }
3646  else
3647  {
3648  $this->tratarExcepcionEstandar($e, $clienteWS);
3649  }
3650  }
3651  }//pf_downloadSign
3652 
3653 
3664  public function pf_queryDocumentTypes($username, $password, $query) {
3665  try
3666  {
3667  $opcionesClienteWS = array (
3668  'soap_version' => SOAP_1_1, //SOAP 1.2
3669  'user_agent' => 'WSSSoapClient',
3670  'exceptions' => true,
3671  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3672  'trace' => self::$MYSOAPOP_TRACE
3673  );
3674 
3675  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
3676  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
3677 
3678  // Nivel de peticion
3679  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
3680  $mainWS->append(new SoapVar($query, XSD_STRING, null, null,'query', self::$NAMESPACE_PF));
3681 
3682  // Realiza la peticion
3683  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'queryDocumentTypes', self::$NAMESPACE_PF);
3684  $respuesta = $clienteWS->queryDocumentTypes($miSoapRQ);
3685 
3686  $vRespuesta = array();
3687  if (is_object($respuesta))
3688  {
3689  $vRespuesta = $this->objectTree2array($respuesta);
3690  }
3691  return($vRespuesta);
3692  }
3693  catch (Exception $e)
3694  {
3695  // Comprobamos si estamos ante excepcion MTOM
3696  $mensaje = $e->getMessage();
3697  $mensaje = trim(strtolower($mensaje));
3698  if ($mensaje == 'looks like we got no xml document')
3699  {
3700  // Obtiene la respuesta
3701  $response = $clienteWS->__getLastResponse();
3702 
3703  // Realiza la interpretacion/sustitucion estandar de MTOM
3704  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'queryDocumentTypesResponse');
3705  return ($vRetorno);
3706  }
3707  else
3708  {
3709  $this->tratarExcepcionEstandar($e, $clienteWS);
3710  }
3711  }
3712  }//pf_queryDocumentTypes
3713 
3714 
3725  public function pf_queryJobs($username, $password, $query) {
3726  try
3727  {
3728  $opcionesClienteWS = array (
3729  'soap_version' => SOAP_1_1, //SOAP 1.2
3730  'user_agent' => 'WSSSoapClient',
3731  'exceptions' => true,
3732  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3733  'trace' => self::$MYSOAPOP_TRACE
3734  );
3735 
3736  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
3737  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
3738 
3739  // Nivel de peticion
3740  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
3741  $mainWS->append(new SoapVar($query, XSD_STRING, null, null,'query', self::$NAMESPACE_PF));
3742 
3743  // Realiza la peticion
3744  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'queryJobs', self::$NAMESPACE_PF);
3745  $respuesta = $clienteWS->queryJobs($miSoapRQ);
3746 
3747  $vRespuesta = array();
3748  if (is_object($respuesta))
3749  {
3750  $vRespuesta = $this->objectTree2array($respuesta);
3751  }
3752  return($vRespuesta);
3753  }
3754  catch (Exception $e)
3755  {
3756  // Comprobamos si estamos ante excepcion MTOM
3757  $mensaje = $e->getMessage();
3758  $mensaje = trim(strtolower($mensaje));
3759  if ($mensaje == 'looks like we got no xml document')
3760  {
3761  // Obtiene la respuesta
3762  $response = $clienteWS->__getLastResponse();
3763 
3764  // Realiza la interpretacion/sustitucion estandar de MTOM
3765  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'queryJobsResponse');
3766  return ($vRetorno);
3767  }
3768  else
3769  {
3770  $this->tratarExcepcionEstandar($e, $clienteWS);
3771  }
3772  }
3773  }//pf_queryJobs
3774 
3775 
3786  public function pf_queryRequest($username, $password, $requestId) {
3787  try
3788  {
3789  $opcionesClienteWS = array (
3790  'soap_version' => SOAP_1_1, //SOAP 1.2
3791  'user_agent' => 'WSSSoapClient',
3792  'exceptions' => true,
3793  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3794  'trace' => self::$MYSOAPOP_TRACE
3795  );
3796 
3797  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
3798  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
3799 
3800  // Nivel de peticion
3801  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
3802  $mainWS->append(new SoapVar($requestId, XSD_STRING, null, null,'requestId', self::$NAMESPACE_PF));
3803 
3804  // Realiza la peticion
3805  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'queryRequest', self::$NAMESPACE_PF);
3806  $respuesta = $clienteWS->queryRequest($miSoapRQ);
3807 
3808  $vRespuesta = array();
3809  if (is_object($respuesta))
3810  {
3811  $vRespuesta = $this->objectTree2array($respuesta);
3812  }
3813  return($vRespuesta);
3814  }
3815  catch (Exception $e)
3816  {
3817  // Comprobamos si estamos ante excepcion MTOM
3818  $mensaje = $e->getMessage();
3819  $mensaje = trim(strtolower($mensaje));
3820  if ($mensaje == 'looks like we got no xml document')
3821  {
3822  // Obtiene la respuesta
3823  $response = $clienteWS->__getLastResponse();
3824 
3825  // Realiza la interpretacion/sustitucion estandar de MTOM
3826  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'queryRequestResponse');
3827  return ($vRetorno);
3828  }
3829  else
3830  {
3831  $this->tratarExcepcionEstandar($e, $clienteWS);
3832  }
3833  }
3834  }//pf_queryRequest
3835 
3836 
3847  public function pf_queryStates($username, $password, $query) {
3848  try
3849  {
3850  $opcionesClienteWS = array (
3851  'soap_version' => SOAP_1_1, //SOAP 1.2
3852  'user_agent' => 'WSSSoapClient',
3853  'exceptions' => true,
3854  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3855  'trace' => self::$MYSOAPOP_TRACE
3856  );
3857 
3858  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
3859  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
3860 
3861  // Nivel de peticion
3862  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
3863  $mainWS->append(new SoapVar($query, XSD_STRING, null, null,'query', self::$NAMESPACE_PF));
3864 
3865  // Realiza la peticion
3866  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'queryStates', self::$NAMESPACE_PF);
3867  $respuesta = $clienteWS->queryStates($miSoapRQ);
3868 
3869  $vRespuesta = array();
3870  if (is_object($respuesta))
3871  {
3872  $vRespuesta = $this->objectTree2array($respuesta);
3873  }
3874  return($vRespuesta);
3875  }
3876  catch (Exception $e)
3877  {
3878  // Comprobamos si estamos ante excepcion MTOM
3879  $mensaje = $e->getMessage();
3880  $mensaje = trim(strtolower($mensaje));
3881  if ($mensaje == 'looks like we got no xml document')
3882  {
3883  // Obtiene la respuesta
3884  $response = $clienteWS->__getLastResponse();
3885 
3886  // Realiza la interpretacion/sustitucion estandar de MTOM
3887  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'queryStatesResponse');
3888  return ($vRetorno);
3889  }
3890  else
3891  {
3892  $this->tratarExcepcionEstandar($e, $clienteWS);
3893  }
3894  }
3895  }//pf_queryStates
3896 
3897 
3908  public function pf_queryUsers($username, $password, $query) {
3909  try
3910  {
3911  $opcionesClienteWS = array (
3912  'soap_version' => SOAP_1_1, //SOAP 1.2
3913  'user_agent' => 'WSSSoapClient',
3914  'exceptions' => true,
3915  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3916  'trace' => self::$MYSOAPOP_TRACE
3917  );
3918 
3919  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
3920  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
3921 
3922  // Nivel de peticion
3923  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
3924  $mainWS->append(new SoapVar($query, XSD_STRING, null, null, 'query', self::$NAMESPACE_PF));
3925 
3926  // Realiza la peticion
3927  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT, null, null, 'queryUsers', self::$NAMESPACE_PF);
3928  $respuesta = $clienteWS->queryUsers($miSoapRQ);
3929 
3930  $vRespuesta = array();
3931  if (is_object($respuesta))
3932  {
3933  $vRespuesta = $this->objectTree2array($respuesta);
3934  }
3935  return($vRespuesta);
3936  }
3937  catch (Exception $e)
3938  {
3939  // Comprobamos si estamos ante excepcion MTOM
3940  $mensaje = $e->getMessage();
3941  $mensaje = trim(strtolower($mensaje));
3942  if ($mensaje == 'looks like we got no xml document')
3943  {
3944  // Obtiene la respuesta
3945  $response = $clienteWS->__getLastResponse();
3946 
3947  // Realiza la interpretacion/sustitucion estandar de MTOM
3948  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'queryUsersResponse');
3949  return ($vRetorno);
3950  }
3951  else
3952  {
3953  $this->tratarExcepcionEstandar($e, $clienteWS);
3954  }
3955  }
3956  }//pf_queryUsers
3957 
3958 
3969  public function pf_queryImportanceLevels($username, $password, $query) {
3970  try
3971  {
3972  $opcionesClienteWS = array (
3973  'soap_version' => SOAP_1_1, //SOAP 1.2
3974  'user_agent' => 'WSSSoapClient',
3975  'exceptions' => true,
3976  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
3977  'trace' => self::$MYSOAPOP_TRACE
3978  );
3979 
3980  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
3981  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
3982 
3983  // Nivel de peticion
3984  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
3985  $mainWS->append(new SoapVar($query, XSD_STRING, null, null, 'query', self::$NAMESPACE_PF));
3986 
3987  // Realiza la peticion
3988  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'queryImportanceLevels', self::$NAMESPACE_PF);
3989  $respuesta = $clienteWS->queryImportanceLevels($miSoapRQ);
3990 
3991  $vRespuesta = array();
3992  if (is_object($respuesta))
3993  {
3994  $vRespuesta = $this->objectTree2array($respuesta);
3995  }
3996  return($vRespuesta);
3997  }
3998  catch (Exception $e)
3999  {
4000  // Comprobamos si estamos ante excepcion MTOM
4001  $mensaje = $e->getMessage();
4002  $mensaje = trim(strtolower($mensaje));
4003  if ($mensaje == 'looks like we got no xml document')
4004  {
4005  // Obtiene la respuesta
4006  $response = $clienteWS->__getLastResponse();
4007 
4008  // Realiza la interpretacion/sustitucion estandar de MTOM
4009  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'queryImportanceLevelsResponse');
4010  return ($vRetorno);
4011  }
4012  else
4013  {
4014  $this->tratarExcepcionEstandar($e, $clienteWS);
4015  }
4016  }
4017  }//pf_queryImportanceLevels
4018 
4019 
4031  public function pf_queryEnhancedUsers($username, $password, $queryUser, $querySeat) {
4032  try
4033  {
4034  $opcionesClienteWS = array (
4035  'soap_version' => SOAP_1_1, //SOAP 1.2
4036  'user_agent' => 'WSSSoapClient',
4037  'exceptions' => true,
4038  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4039  'trace' => self::$MYSOAPOP_TRACE
4040  );
4041 
4042  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
4043  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
4044 
4045  // Nivel de peticion
4046  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
4047  $mainWS->append(new SoapVar($queryUser, XSD_STRING, null, null,'queryUser', self::$NAMESPACE_PF));
4048  $mainWS->append(new SoapVar($querySeat, XSD_STRING, null, null,'querySeat', self::$NAMESPACE_PF));
4049 
4050  // Realiza la peticion
4051  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'queryEnhancedUsers', self::$NAMESPACE_PF);
4052  $respuesta = $clienteWS->queryEnhancedUsers($miSoapRQ);
4053 
4054  $vRespuesta = array();
4055  if (is_object($respuesta))
4056  {
4057  $vRespuesta = $this->objectTree2array($respuesta);
4058  }
4059  return($vRespuesta);
4060  }
4061  catch (Exception $e)
4062  {
4063  // Comprobamos si estamos ante excepcion MTOM
4064  $mensaje = $e->getMessage();
4065  $mensaje = trim(strtolower($mensaje));
4066  if ($mensaje == 'looks like we got no xml document')
4067  {
4068  // Obtiene la respuesta
4069  $response = $clienteWS->__getLastResponse();
4070 
4071  // Realiza la interpretacion/sustitucion estandar de MTOM
4072  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'queryEnhancedUsersResponse');
4073  return ($vRetorno);
4074  }
4075  else
4076  {
4077  $this->tratarExcepcionEstandar($e, $clienteWS);
4078  }
4079  }
4080  }//pf_queryEnhancedUsers
4081 
4082 
4094  public function pf_queryEnhancedJobs($username, $password, $queryJob, $querySeat) {
4095  try
4096  {
4097  $opcionesClienteWS = array (
4098  'soap_version' => SOAP_1_1, //SOAP 1.2
4099  'user_agent' => 'WSSSoapClient',
4100  'exceptions' => true,
4101  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4102  'trace' => self::$MYSOAPOP_TRACE
4103  );
4104 
4105  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
4106  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
4107 
4108  // Nivel de peticion
4109  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
4110  $mainWS->append(new SoapVar($queryJob, XSD_STRING, null, null,'queryJob', self::$NAMESPACE_PF));
4111  $mainWS->append(new SoapVar($querySeat, XSD_STRING, null, null,'querySeat', self::$NAMESPACE_PF));
4112 
4113  // Realiza la peticion
4114  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'queryEnhancedJobs', self::$NAMESPACE_PF);
4115  $respuesta = $clienteWS->queryEnhancedJobs($miSoapRQ);
4116 
4117  $vRespuesta = array();
4118  if (is_object($respuesta))
4119  {
4120  $vRespuesta = $this->objectTree2array($respuesta);
4121  }
4122  return($vRespuesta);
4123  }
4124  catch (Exception $e)
4125  {
4126  // Comprobamos si estamos ante excepcion MTOM
4127  $mensaje = $e->getMessage();
4128  $mensaje = trim(strtolower($mensaje));
4129  if ($mensaje == 'looks like we got no xml document')
4130  {
4131  // Obtiene la respuesta
4132  $response = $clienteWS->__getLastResponse();
4133 
4134  // Realiza la interpretacion/sustitucion estandar de MTOM
4135  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'queryEnhancedJobsResponse');
4136  return ($vRetorno);
4137  }
4138  else
4139  {
4140  $this->tratarExcepcionEstandar($e, $clienteWS);
4141  }
4142  }
4143  }//pf_queryEnhancedJobs
4144 
4145 
4156  public function pf_queryEnhancedUserJobAssociatedToJob($username, $password, $jobIdentifier) {
4157  try
4158  {
4159  $opcionesClienteWS = array (
4160  'soap_version' => SOAP_1_1, //SOAP 1.2
4161  'user_agent' => 'WSSSoapClient',
4162  'exceptions' => true,
4163  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4164  'trace' => self::$MYSOAPOP_TRACE
4165  );
4166 
4167  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
4168  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
4169 
4170  // Nivel de peticion
4171  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
4172  $mainWS->append(new SoapVar($jobIdentifier, XSD_STRING, null, null,'jobIdentifier', self::$NAMESPACE_PF));
4173 
4174  // Realiza la peticion
4175  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'queryEnhancedUserJobAssociatedToJob', self::$NAMESPACE_PF);
4176  $respuesta = $clienteWS->queryEnhancedUserJobAssociatedToJob($miSoapRQ);
4177 
4178  $vRespuesta = array();
4179  if (is_object($respuesta))
4180  {
4181  $vRespuesta = $this->objectTree2array($respuesta);
4182  }
4183  return($vRespuesta);
4184  }
4185  catch (Exception $e)
4186  {
4187  // Comprobamos si estamos ante excepcion MTOM
4188  $mensaje = $e->getMessage();
4189  $mensaje = trim(strtolower($mensaje));
4190  if ($mensaje == 'looks like we got no xml document')
4191  {
4192  // Obtiene la respuesta
4193  $response = $clienteWS->__getLastResponse();
4194 
4195  // Realiza la interpretacion/sustitucion estandar de MTOM
4196  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'queryEnhancedUserJobAssociatedToJobResponse');
4197  return ($vRetorno);
4198  }
4199  else
4200  {
4201  $this->tratarExcepcionEstandar($e, $clienteWS);
4202  }
4203  }
4204  }//pf_queryEnhancedUserJobAssociatedToJob
4205 
4206 
4217  public function pf_queryEnhancedUserJobAssociatedToUser($username, $password, $userIdentifier) {
4218  try
4219  {
4220  $opcionesClienteWS = array (
4221  'soap_version' => SOAP_1_1, //SOAP 1.2
4222  'user_agent' => 'WSSSoapClient',
4223  'exceptions' => true,
4224  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4225  'trace' => self::$MYSOAPOP_TRACE
4226  );
4227 
4228  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
4229  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
4230 
4231  // Nivel de peticion
4232  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
4233  $mainWS->append(new SoapVar($userIdentifier, XSD_STRING, null, null, 'userIdentifier', self::$NAMESPACE_PF));
4234 
4235  // Realiza la peticion
4236  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'queryEnhancedUserJobAssociatedToUser', self::$NAMESPACE_PF);
4237  $respuesta = $clienteWS->queryEnhancedUserJobAssociatedToUser($miSoapRQ);
4238 
4239  $vRespuesta = array();
4240  if (is_object($respuesta))
4241  {
4242  $vRespuesta = $this->objectTree2array($respuesta);
4243  }
4244  return($vRespuesta);
4245  }
4246  catch (Exception $e)
4247  {
4248  // Comprobamos si estamos ante excepcion MTOM
4249  $mensaje = $e->getMessage();
4250  $mensaje = trim(strtolower($mensaje));
4251  if ($mensaje == 'looks like we got no xml document')
4252  {
4253  // Obtiene la respuesta
4254  $response = $clienteWS->__getLastResponse();
4255 
4256  // Realiza la interpretacion/sustitucion estandar de MTOM
4257  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'queryEnhancedUserJobAssociatedToUserResponse');
4258  return ($vRetorno);
4259  }
4260  else
4261  {
4262  $this->tratarExcepcionEstandar($e, $clienteWS);
4263  }
4264  }
4265  }//pf_queryEnhancedUserJobAssociatedToJob
4266 
4267 
4278  public function pf_querySeats($username, $password, $query) {
4279  try
4280  {
4281  $opcionesClienteWS = array (
4282  'soap_version' => SOAP_1_1, //SOAP 1.2
4283  'user_agent' => 'WSSSoapClient',
4284  'exceptions' => true,
4285  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4286  'trace' => self::$MYSOAPOP_TRACE
4287  );
4288 
4289  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
4290  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
4291 
4292  // Nivel de peticion
4293  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
4294  $mainWS->append(new SoapVar($query, XSD_STRING, null, null,'query', self::$NAMESPACE_PF));
4295 
4296  // Realiza la peticion
4297  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'querySeats', self::$NAMESPACE_PF);
4298  $respuesta = $clienteWS->querySeats($miSoapRQ);
4299 
4300  $vRespuesta = array();
4301  if (is_object($respuesta))
4302  {
4303  $vRespuesta = $this->objectTree2array($respuesta);
4304  }
4305  return($vRespuesta);
4306  }
4307  catch (Exception $e)
4308  {
4309  // Comprobamos si estamos ante excepcion MTOM
4310  $mensaje = $e->getMessage();
4311  $mensaje = trim(strtolower($mensaje));
4312  if ($mensaje == 'looks like we got no xml document')
4313  {
4314  // Obtiene la respuesta
4315  $response = $clienteWS->__getLastResponse();
4316 
4317  // Realiza la interpretacion/sustitucion estandar de MTOM
4318  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'querySeatsResponse');
4319  return ($vRetorno);
4320  }
4321  else
4322  {
4323  $this->tratarExcepcionEstandar($e, $clienteWS);
4324  }
4325  }
4326  }//pf_querySeats
4327 
4328 
4339  public function pf_querySign($username, $password, $documentId) {
4340  try
4341  {
4342  $opcionesClienteWS = array (
4343  'soap_version' => SOAP_1_1, //SOAP 1.2
4344  'user_agent' => 'WSSSoapClient',
4345  'exceptions' => true,
4346  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4347  'trace' => self::$MYSOAPOP_TRACE
4348  );
4349 
4350  $this->__clienteOn(self::KEYCLIENTE_PF, true, $opcionesClienteWS);
4351  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF);
4352 
4353  // Nivel de peticion
4354  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF);
4355  $mainWS->append(new SoapVar($documentId, XSD_STRING, null, null,'documentId', self::$NAMESPACE_PF));
4356 
4357  // Realiza la peticion
4358  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'querySign', self::$NAMESPACE_PF);
4359  $respuesta = $clienteWS->querySign($miSoapRQ);
4360 
4361  $vRespuesta = array();
4362  if (is_object($respuesta))
4363  {
4364  $vRespuesta = $this->objectTree2array($respuesta);
4365  }
4366  return($vRespuesta);
4367  }
4368  catch (Exception $e)
4369  {
4370  // Comprobamos si estamos ante excepcion MTOM
4371  $mensaje = $e->getMessage();
4372  $mensaje = trim(strtolower($mensaje));
4373  if ($mensaje == 'looks like we got no xml document')
4374  {
4375  // Obtiene la respuesta
4376  $response = $clienteWS->__getLastResponse();
4377 
4378  // Realiza la interpretacion/sustitucion estandar de MTOM
4379  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'querySignResponse');
4380  return ($vRetorno);
4381 
4382  }
4383  else
4384  {
4385  $this->tratarExcepcionEstandar($e, $clienteWS);
4386  }
4387  }
4388  }//pf_querySign
4389 
4390 
4401  public function pf_mod_createRequest($username, $password, $request) {
4402  try
4403  {
4404  $opcionesClienteWS = array (
4405  'soap_version' => SOAP_1_1, //SOAP 1.2
4406  'user_agent' => 'WSSSoapClient',
4407  'exceptions' => true,
4408  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4409  'trace' => self::$MYSOAPOP_TRACE
4410  );
4411 
4412  $this->__clienteOn(self::KEYCLIENTE_PF_MOD, true, $opcionesClienteWS);
4413  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_MOD);
4414 
4415  // Nivel de peticion
4416  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_MOD);
4417  $mainWS->append($request->toSoap('request', self::$NAMESPACE_PF_MOD));
4418 
4419  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'createRequest', self::$NAMESPACE_PF_MOD);
4420  $respuesta = $clienteWS->createRequest($miSoapRQ);
4421 
4422  $vRespuesta = array();
4423  if (is_object($respuesta))
4424  {
4425  $vRespuesta = $this->objectTree2array($respuesta);
4426  }
4427  return($vRespuesta);
4428  }
4429  catch (Exception $e)
4430  {
4431  // Comprobamos si estamos ante excepcion MTOM
4432  $mensaje = $e->getMessage();
4433  $mensaje = trim(strtolower($mensaje));
4434  if ($mensaje == 'looks like we got no xml document')
4435  {
4436  // Obtiene la respuesta
4437  $response = $clienteWS->__getLastResponse();
4438 
4439  // Realiza la interpretacion/sustitucion estandar de MTOM
4440  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'createRequestResponse');
4441  return ($vRetorno);
4442  }
4443  else
4444  {
4445  $this->tratarExcepcionEstandar($e, $clienteWS);
4446  }
4447  }
4448  }//pf_mod_createRequest
4449 
4450 
4461  public function pf_mod_deleteDocument($username, $password, $documentId) {
4462  try
4463  {
4464  $opcionesClienteWS = array (
4465  'soap_version' => SOAP_1_1, //SOAP 1.2
4466  'user_agent' => 'WSSSoapClient',
4467  'exceptions' => true,
4468  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4469  'trace' => self::$MYSOAPOP_TRACE
4470  );
4471 
4472  $this->__clienteOn(self::KEYCLIENTE_PF_MOD, true, $opcionesClienteWS);
4473  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_MOD);
4474 
4475  // Nivel de peticion
4476  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_MOD);
4477  $mainWS->append(new SoapVar($documentId, XSD_STRING, null, null,'documentId', self::$NAMESPACE_PF_MOD));
4478 
4479  // Realiza la peticion
4480  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'deleteDocument', self::$NAMESPACE_PF_MOD);
4481  $respuesta = $clienteWS->deleteDocument($miSoapRQ);
4482 
4483  $vRespuesta = array();
4484  if (is_object($respuesta))
4485  {
4486  $vRespuesta = $this->objectTree2array($respuesta);
4487  }
4488  return($vRespuesta);
4489  }
4490  catch (Exception $e)
4491  {
4492  // Comprobamos si estamos ante excepcion MTOM
4493  $mensaje = $e->getMessage();
4494  $mensaje = trim(strtolower($mensaje));
4495  if ($mensaje == 'looks like we got no xml document')
4496  {
4497  // Obtiene la respuesta
4498  $response = $clienteWS->__getLastResponse();
4499 
4500  // Realiza la interpretacion/sustitucion estandar de MTOM
4501  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'deleteDocumentResponse');
4502  return ($vRetorno);
4503  }
4504  else
4505  {
4506  $this->tratarExcepcionEstandar($e, $clienteWS);
4507  }
4508  }
4509  }//pf_mod_deleteDocument
4510 
4511 
4522  public function pf_mod_deleteRequest($username, $password, $requestId) {
4523  try
4524  {
4525  $opcionesClienteWS = array (
4526  'soap_version' => SOAP_1_1, //SOAP 1.2
4527  'user_agent' => 'WSSSoapClient',
4528  'exceptions' => true,
4529  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4530  'trace' => self::$MYSOAPOP_TRACE
4531  );
4532 
4533  $this->__clienteOn(self::KEYCLIENTE_PF_MOD, true, $opcionesClienteWS);
4534  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_MOD);
4535 
4536  // Nivel de peticion
4537  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_MOD);
4538  $mainWS->append(new SoapVar($requestId, XSD_STRING, null, null,'requestId', self::$NAMESPACE_PF_MOD));
4539 
4540  // Realiza la peticion
4541  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'deleteRequest', self::$NAMESPACE_PF_MOD);
4542  $respuesta = $clienteWS->deleteRequest($miSoapRQ);
4543 
4544  $vRespuesta = array();
4545  if (is_object($respuesta))
4546  {
4547  $vRespuesta = $this->objectTree2array($respuesta);
4548  }
4549  return($vRespuesta);
4550  }
4551  catch (Exception $e)
4552  {
4553  // Comprobamos si estamos ante excepcion MTOM
4554  $mensaje = $e->getMessage();
4555  $mensaje = trim(strtolower($mensaje));
4556  if ($mensaje == 'looks like we got no xml document')
4557  {
4558  // Obtiene la respuesta
4559  $response = $clienteWS->__getLastResponse();
4560 
4561  // Realiza la interpretacion/sustitucion estandar de MTOM
4562  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'deleteRequestResponse');
4563  return ($vRetorno);
4564  }
4565  else
4566  {
4567  $this->tratarExcepcionEstandar($e, $clienteWS);
4568  }
4569  }
4570  }//pf_mod_deleteRequest
4571 
4572 
4584  public function pf_mod_deleteSigners($username, $password, $requestId, $signerList) {
4585  try
4586  {
4587  $opcionesClienteWS = array (
4588  'soap_version' => SOAP_1_1, //SOAP 1.2
4589  'user_agent' => 'WSSSoapClient',
4590  'exceptions' => true,
4591  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4592  'trace' => self::$MYSOAPOP_TRACE
4593  );
4594 
4595  $this->__clienteOn(self::KEYCLIENTE_PF_MOD, true, $opcionesClienteWS);
4596  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_MOD);
4597 
4598  // Nivel de peticion
4599  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_MOD);
4600  $mainWS->append(new SoapVar($requestId, XSD_STRING, null, null,'requestId', self::$NAMESPACE_PF_MOD));
4601  $mainWS->append($signerList->toSoap('signerList', self::$NAMESPACE_PF_MOD));
4602 
4603  // Realiza la peticion
4604  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'deleteSigners', self::$NAMESPACE_PF_MOD);
4605  $respuesta = $clienteWS->deleteSigners($miSoapRQ);
4606 
4607  $vRespuesta = array();
4608  if (is_object($respuesta))
4609  {
4610  $vRespuesta = $this->objectTree2array($respuesta);
4611  }
4612  return($vRespuesta);
4613  }
4614  catch (Exception $e)
4615  {
4616  // Comprobamos si estamos ante excepcion MTOM
4617  $mensaje = $e->getMessage();
4618  $mensaje = trim(strtolower($mensaje));
4619  if ($mensaje == 'looks like we got no xml document')
4620  {
4621  // Obtiene la respuesta
4622  $response = $clienteWS->__getLastResponse();
4623 
4624  // Realiza la interpretacion/sustitucion estandar de MTOM
4625  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'deleteSignersResponse');
4626  return ($vRetorno);
4627  }
4628  else
4629  {
4630  $this->tratarExcepcionEstandar($e, $clienteWS);
4631  }
4632  }
4633  }//pf_mod_deleteSigners
4634 
4635 
4647  public function pf_mod_insertDocument($username, $password, $requestId, $document) {
4648  try
4649  {
4650  $opcionesClienteWS = array (
4651  'soap_version' => SOAP_1_1, //SOAP 1.2
4652  'user_agent' => 'WSSSoapClient',
4653  'exceptions' => true,
4654  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4655  'trace' => self::$MYSOAPOP_TRACE
4656  );
4657 
4658  $this->__clienteOn(self::KEYCLIENTE_PF_MOD, true, $opcionesClienteWS);
4659  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_MOD);
4660 
4661  // Nivel de peticion
4662  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_MOD);
4663  $mainWS->append(new SoapVar($requestId, XSD_STRING, null, null,'requestId', self::$NAMESPACE_PF_MOD));
4664  $mainWS->append($document->toSoap('document', self::$NAMESPACE_PF_MOD));
4665 
4666  // Realiza la peticion
4667  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'insertDocument', self::$NAMESPACE_PF_MOD);
4668  $respuesta = $clienteWS->insertDocument($miSoapRQ);
4669 
4670  $vRespuesta = array();
4671  if (is_object($respuesta))
4672  {
4673  $vRespuesta = $this->objectTree2array($respuesta);
4674  }
4675  return($vRespuesta);
4676  }
4677  catch (Exception $e)
4678  {
4679  // Comprobamos si estamos ante excepcion MTOM
4680  $mensaje = $e->getMessage();
4681  $mensaje = trim(strtolower($mensaje));
4682  if ($mensaje == 'looks like we got no xml document')
4683  {
4684  // Obtiene la respuesta
4685  $response = $clienteWS->__getLastResponse();
4686 
4687  // Realiza la interpretacion/sustitucion estandar de MTOM
4688  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'insertDocumentResponse');
4689  return ($vRetorno);
4690  }
4691  else
4692  {
4693  $this->tratarExcepcionEstandar($e, $clienteWS);
4694  }
4695  }
4696  }//pf_mod_insertDocument
4697 
4698 
4712  public function pf_mod_insertSigners($username, $password, $requestId, $signLine, $signerList, $signLineType) {
4713  try
4714  {
4715  $opcionesClienteWS = array (
4716  'soap_version' => SOAP_1_1, //SOAP 1.2
4717  'user_agent' => 'WSSSoapClient',
4718  'exceptions' => true,
4719  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4720  'trace' => self::$MYSOAPOP_TRACE
4721  );
4722 
4723  $this->__clienteOn(self::KEYCLIENTE_PF_MOD, true, $opcionesClienteWS);
4724  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_MOD);
4725 
4726  // Nivel de peticion
4727  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_MOD);
4728  $mainWS->append(new SoapVar($requestId, XSD_STRING, null, null,'requestId', self::$NAMESPACE_PF_MOD));
4729  $mainWS->append(new SoapVar($signLine, XSD_INT,null,null, 'signLine', self::$NAMESPACE_PF_MOD));
4730  $mainWS->append($signerList->toSoap('signerList', self::$NAMESPACE_PF_MOD));
4731  $mainWS->append(new SoapVar($signLineType, XSD_STRING, null, null, 'signLineType', self::$NAMESPACE_PF_MOD));
4732  // Realiza la peticion
4733  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'insertSigners', self::$NAMESPACE_PF_MOD);
4734  $respuesta = $clienteWS->insertSigners($miSoapRQ);
4735 
4736  $vRespuesta = array();
4737  if (is_object($respuesta))
4738  {
4739  $vRespuesta = $this->objectTree2array($respuesta);
4740  }
4741  return($vRespuesta);
4742  }
4743  catch (Exception $e)
4744  {
4745  // Comprobamos si estamos ante excepcion MTOM
4746  $mensaje = $e->getMessage();
4747  $mensaje = trim(strtolower($mensaje));
4748  if ($mensaje == 'looks like we got no xml document')
4749  {
4750  // Obtiene la respuesta
4751  $response = $clienteWS->__getLastResponse();
4752 
4753  // Realiza la interpretacion/sustitucion estandar de MTOM
4754  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'insertSignersResponse');
4755  return ($vRetorno);
4756  }
4757  else
4758  {
4759  $this->tratarExcepcionEstandar($e, $clienteWS);
4760  }
4761  }
4762  }//pf_mod_insertSigners
4763 
4764 
4775  public function pf_mod_sendRequest($username, $password, $requestId) {
4776  try
4777  {
4778  $opcionesClienteWS = array (
4779  'soap_version' => SOAP_1_1, //SOAP 1.2
4780  'user_agent' => 'WSSSoapClient',
4781  'exceptions' => true,
4782  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4783  'trace' => self::$MYSOAPOP_TRACE
4784  );
4785 
4786  $this->__clienteOn(self::KEYCLIENTE_PF_MOD, true, $opcionesClienteWS);
4787  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_MOD);
4788 
4789  // Nivel de peticion
4790  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_MOD);
4791  $mainWS->append(new SoapVar($requestId, XSD_STRING, null, null,'requestId', self::$NAMESPACE_PF_MOD));
4792 
4793  // Realiza la peticion
4794  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'sendRequest', self::$NAMESPACE_PF_MOD);
4795  $respuesta = $clienteWS->sendRequest($miSoapRQ);
4796 
4797  $vRespuesta = array();
4798  if (is_object($respuesta))
4799  {
4800  $vRespuesta = $this->objectTree2array($respuesta);
4801  }
4802  return($vRespuesta);
4803  }
4804  catch (Exception $e)
4805  {
4806  // Comprobamos si estamos ante excepcion MTOM
4807  $mensaje = $e->getMessage();
4808  $mensaje = trim(strtolower($mensaje));
4809  if ($mensaje == 'looks like we got no xml document')
4810  {
4811  // Obtiene la respuesta
4812  $response = $clienteWS->__getLastResponse();
4813 
4814  // Realiza la interpretacion/sustitucion estandar de MTOM
4815  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'sendRequestResponse');
4816  return ($vRetorno);
4817  }
4818  else
4819  {
4820  $this->tratarExcepcionEstandar($e, $clienteWS);
4821  }
4822  }
4823  }//pf_mod_sendRequest
4824 
4825 
4836  public function pf_mod_updateRequest($username, $password, $request) {
4837  try
4838  {
4839  $opcionesClienteWS = array (
4840  'soap_version' => SOAP_1_1, //SOAP 1.2
4841  'user_agent' => 'WSSSoapClient',
4842  'exceptions' => true,
4843  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4844  'trace' => self::$MYSOAPOP_TRACE
4845  );
4846 
4847  $this->__clienteOn(self::KEYCLIENTE_PF_MOD, true, $opcionesClienteWS);
4848  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_MOD);
4849 
4850  // Nivel de peticion
4851  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_MOD);
4852  $mainWS->append($request->toSoap('request', self::$NAMESPACE_PF_MOD));
4853 
4854  // Realiza la peticion
4855  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'updateRequest', self::$NAMESPACE_PF_MOD);
4856  $respuesta = $clienteWS->updateRequest($miSoapRQ);
4857 
4858  $vRespuesta = array();
4859  if (is_object($respuesta))
4860  {
4861  $vRespuesta = $this->objectTree2array($respuesta);
4862  }
4863  return($vRespuesta);
4864  }
4865  catch (Exception $e)
4866  {
4867  // Comprobamos si estamos ante excepcion MTOM
4868  $mensaje = $e->getMessage();
4869  $mensaje = trim(strtolower($mensaje));
4870  if ($mensaje == 'looks like we got no xml document')
4871  {
4872  // Obtiene la respuesta
4873  $response = $clienteWS->__getLastResponse();
4874 
4875  // Realiza la interpretacion/sustitucion estandar de MTOM
4876  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'updateRequestResponse');
4877  return ($vRetorno);
4878  }
4879  else
4880  {
4881  $this->tratarExcepcionEstandar($e, $clienteWS);
4882  }
4883  }
4884  }//pf_mod_updateRequest
4885 
4886 
4898  public function pf_mod_removeRequest($username, $password, $requestId, $removingMessage) {
4899  try
4900  {
4901  $opcionesClienteWS = array (
4902  'soap_version' => SOAP_1_1, //SOAP 1.2
4903  'user_agent' => 'WSSSoapClient',
4904  'exceptions' => true,
4905  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4906  'trace' => self::$MYSOAPOP_TRACE
4907  );
4908 
4909  $this->__clienteOn(self::KEYCLIENTE_PF_MOD, true, $opcionesClienteWS);
4910  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_MOD);
4911 
4912  // Nivel de peticion
4913  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_MOD);
4914  $mainWS->append(new SoapVar($requestId, XSD_STRING, null, null,'requestId', self::$NAMESPACE_PF_MOD));
4915  $mainWS->append(new SoapVar($removingMessage, XSD_STRING, null, null,'removingMessage', self::$NAMESPACE_PF_MOD));
4916 
4917  // Realiza la peticion
4918  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'removeRequest', self::$NAMESPACE_PF_MOD);
4919  $respuesta = $clienteWS->removeRequest($miSoapRQ);
4920 
4921  $vRespuesta = array();
4922  if (is_object($respuesta))
4923  {
4924  $vRespuesta = $this->objectTree2array($respuesta);
4925  }
4926  return($vRespuesta);
4927  }
4928  catch (Exception $e)
4929  {
4930  // Comprobamos si estamos ante excepcion MTOM
4931  $mensaje = $e->getMessage();
4932  $mensaje = trim(strtolower($mensaje));
4933  if ($mensaje == 'looks like we got no xml document')
4934  {
4935  // Obtiene la respuesta
4936  $response = $clienteWS->__getLastResponse();
4937 
4938  // Realiza la interpretacion/sustitucion estandar de MTOM
4939  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'removeRequestResponse');
4940  return ($vRetorno);
4941  }
4942  else
4943  {
4944  $this->tratarExcepcionEstandar($e, $clienteWS);
4945  }
4946  }
4947  }//pf_mod_removeRequest
4948 
4949 
4960  public function pf_adm_insertEnhancedUsers($username, $password, $enhancedUserList) {
4961  try
4962  {
4963  $opcionesClienteWS = array (
4964  'soap_version' => SOAP_1_1, //SOAP 1.2
4965  'user_agent' => 'WSSSoapClient',
4966  'exceptions' => true,
4967  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
4968  'trace' => self::$MYSOAPOP_TRACE
4969  );
4970 
4971  $this->__clienteOn(self::KEYCLIENTE_PF_ADM, true, $opcionesClienteWS);
4972  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_ADM);
4973 
4974  // Nivel de peticion
4975  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_ADM);
4976  $mainWS->append($enhancedUserList->toSoap('enhancedUserList', self::$NAMESPACE_PF_ADM));
4977 
4978  // Realiza la peticion
4979  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'insertEnhancedUsers', self::$NAMESPACE_PF_ADM);
4980  $respuesta = $clienteWS->insertEnhancedUsers($miSoapRQ);
4981 
4982  $vRespuesta = array();
4983  if (is_object($respuesta))
4984  {
4985  $vRespuesta = $this->objectTree2array($respuesta);
4986  }
4987  return($vRespuesta);
4988  }
4989  catch (Exception $e)
4990  {
4991  // Comprobamos si estamos ante excepcion MTOM
4992  $mensaje = $e->getMessage();
4993  $mensaje = trim(strtolower($mensaje));
4994  if ($mensaje == 'looks like we got no xml document')
4995  {
4996  // Obtiene la respuesta
4997  $response = $clienteWS->__getLastResponse();
4998 
4999  // Realiza la interpretacion/sustitucion estandar de MTOM
5000  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'insertEnhancedUsersResponse');
5001  return ($vRetorno);
5002  }
5003  else
5004  {
5005  $this->tratarExcepcionEstandar($e, $clienteWS);
5006  }
5007  }
5008  }//pf_adm_insertEnhancedUsers
5009 
5010 
5021  public function pf_adm_updateEnhancedUsers($username, $password, $enhancedUserList) {
5022  try
5023  {
5024  $opcionesClienteWS = array (
5025  'soap_version' => SOAP_1_1, //SOAP 1.2
5026  'user_agent' => 'WSSSoapClient',
5027  'exceptions' => true,
5028  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5029  'trace' => self::$MYSOAPOP_TRACE
5030  );
5031 
5032  $this->__clienteOn(self::KEYCLIENTE_PF_ADM, true, $opcionesClienteWS);
5033  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_ADM);
5034 
5035  // Nivel de peticion
5036  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_ADM);
5037  $mainWS->append($enhancedUserList->toSoap('enhancedUserList', self::$NAMESPACE_PF_ADM));
5038 
5039  // Realiza la peticion
5040  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'updateEnhancedUsers', self::$NAMESPACE_PF_ADM);
5041  $respuesta = $clienteWS->updateEnhancedUsers($miSoapRQ);
5042 
5043  $vRespuesta = array();
5044  if (is_object($respuesta))
5045  {
5046  $vRespuesta = $this->objectTree2array($respuesta);
5047  }
5048  return($vRespuesta);
5049  }
5050  catch (Exception $e)
5051  {
5052  // Comprobamos si estamos ante excepcion MTOM
5053  $mensaje = $e->getMessage();
5054  $mensaje = trim(strtolower($mensaje));
5055  if ($mensaje == 'looks like we got no xml document')
5056  {
5057  // Obtiene la respuesta
5058  $response = $clienteWS->__getLastResponse();
5059 
5060  // Realiza la interpretacion/sustitucion estandar de MTOM
5061  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'updateEnhancedUsersResponse');
5062  return ($vRetorno);
5063  }
5064  else
5065  {
5066  $this->tratarExcepcionEstandar($e, $clienteWS);
5067  }
5068  }
5069  }//pf_adm_updateEnhancedUsers
5070 
5071 
5082  public function pf_adm_deleteUsers($username, $password, $userIdentifierList) {
5083  try
5084  {
5085  $opcionesClienteWS = array (
5086  'soap_version' => SOAP_1_1, //SOAP 1.2
5087  'user_agent' => 'WSSSoapClient',
5088  'exceptions' => true,
5089  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5090  'trace' => self::$MYSOAPOP_TRACE
5091  );
5092 
5093  $this->__clienteOn(self::KEYCLIENTE_PF_ADM, true, $opcionesClienteWS);
5094  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_ADM);
5095 
5096  // Nivel de peticion
5097  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_ADM);
5098  $mainWS->append($userIdentifierList->toSoap('userIdentifierList', self::$NAMESPACE_PF_ADM));
5099 
5100  // Realiza la peticion
5101  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'deleteUsers', self::$NAMESPACE_PF_ADM);
5102  $respuesta = $clienteWS->deleteUsers($miSoapRQ);
5103 
5104  $vRespuesta = array();
5105  if (is_object($respuesta))
5106  {
5107  $vRespuesta = $this->objectTree2array($respuesta);
5108  }
5109  return($vRespuesta);
5110  }
5111  catch (Exception $e)
5112  {
5113  // Comprobamos si estamos ante excepcion MTOM
5114  $mensaje = $e->getMessage();
5115  $mensaje = trim(strtolower($mensaje));
5116  if ($mensaje == 'looks like we got no xml document')
5117  {
5118  // Obtiene la respuesta
5119  $response = $clienteWS->__getLastResponse();
5120 
5121  // Realiza la interpretacion/sustitucion estandar de MTOM
5122  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'deleteUsersResponse');
5123  return ($vRetorno);
5124  }
5125  else
5126  {
5127  $this->tratarExcepcionEstandar($e, $clienteWS);
5128  }
5129  }
5130  }//pf_adm_deleteUsers
5131 
5132 
5143  public function pf_adm_insertEnhancedJobs($username, $password, $enhancedJobList) {
5144  try
5145  {
5146  $opcionesClienteWS = array (
5147  'soap_version' => SOAP_1_1, //SOAP 1.2
5148  'user_agent' => 'WSSSoapClient',
5149  'exceptions' => true,
5150  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5151  'trace' => self::$MYSOAPOP_TRACE
5152  );
5153 
5154  $this->__clienteOn(self::KEYCLIENTE_PF_ADM, true, $opcionesClienteWS);
5155  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_ADM);
5156 
5157  // Nivel de peticion
5158  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_ADM);
5159  $mainWS->append($enhancedJobList->toSoap('enhancedJobList', self::$NAMESPACE_PF_ADM));
5160 
5161  // Realiza la peticion
5162  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'insertEnhancedJobs', self::$NAMESPACE_PF_ADM);
5163  $respuesta = $clienteWS->insertEnhancedJobs($miSoapRQ);
5164 
5165  $vRespuesta = array();
5166  if (is_object($respuesta))
5167  {
5168  $vRespuesta = $this->objectTree2array($respuesta);
5169  }
5170  return($vRespuesta);
5171  }
5172  catch (Exception $e)
5173  {
5174  // Comprobamos si estamos ante excepcion MTOM
5175  $mensaje = $e->getMessage();
5176  $mensaje = trim(strtolower($mensaje));
5177  if ($mensaje == 'looks like we got no xml document')
5178  {
5179  // Obtiene la respuesta
5180  $response = $clienteWS->__getLastResponse();
5181 
5182  // Realiza la interpretacion/sustitucion estandar de MTOM
5183  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'insertEnhancedJobsResponse');
5184  return ($vRetorno);
5185  }
5186  else
5187  {
5188  $this->tratarExcepcionEstandar($e, $clienteWS);
5189  }
5190  }
5191  }//pf_adm_insertEnhancedJobs
5192 
5193 
5204  public function pf_adm_updateEnhancedJobs($username, $password, $enhancedJobList) {
5205  try
5206  {
5207  $opcionesClienteWS = array (
5208  'soap_version' => SOAP_1_1, //SOAP 1.2
5209  'user_agent' => 'WSSSoapClient',
5210  'exceptions' => true,
5211  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5212  'trace' => self::$MYSOAPOP_TRACE
5213  );
5214 
5215  $this->__clienteOn(self::KEYCLIENTE_PF_ADM, true, $opcionesClienteWS);
5216  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_ADM);
5217 
5218  // Nivel de peticion
5219  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_ADM);
5220  $mainWS->append($enhancedJobList->toSoap('enhancedJobList', self::$NAMESPACE_PF_ADM));
5221 
5222  // Realiza la peticion
5223  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'updateEnhancedJobs', self::$NAMESPACE_PF_ADM);
5224  $respuesta = $clienteWS->updateEnhancedJobs($miSoapRQ);
5225 
5226  $vRespuesta = array();
5227  if (is_object($respuesta))
5228  {
5229  $vRespuesta = $this->objectTree2array($respuesta);
5230  }
5231  return($vRespuesta);
5232  }
5233  catch (Exception $e)
5234  {
5235  // Comprobamos si estamos ante excepcion MTOM
5236  $mensaje = $e->getMessage();
5237  $mensaje = trim(strtolower($mensaje));
5238  if ($mensaje == 'looks like we got no xml document')
5239  {
5240  // Obtiene la respuesta
5241  $response = $clienteWS->__getLastResponse();
5242 
5243  // Realiza la interpretacion/sustitucion estandar de MTOM
5244  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'updateEnhancedJobsResponse');
5245  return ($vRetorno);
5246  }
5247  else
5248  {
5249  $this->tratarExcepcionEstandar($e, $clienteWS);
5250  }
5251  }
5252  }//pf_adm_updateEnhancedJobs
5253 
5254 
5265  public function pf_adm_deleteJobs($username, $password, $jobIdentifierList) {
5266  try
5267  {
5268  $opcionesClienteWS = array (
5269  'soap_version' => SOAP_1_1, //SOAP 1.2
5270  'user_agent' => 'WSSSoapClient',
5271  'exceptions' => true,
5272  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5273  'trace' => self::$MYSOAPOP_TRACE
5274  );
5275 
5276  $this->__clienteOn(self::KEYCLIENTE_PF_ADM, true, $opcionesClienteWS);
5277  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_ADM);
5278 
5279  // Nivel de peticion
5280  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_ADM);
5281  $mainWS->append($jobIdentifierList->toSoap('jobIdentifierList', self::$NAMESPACE_PF_ADM));
5282 
5283  // Realiza la peticion
5284  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'deleteJobs', self::$NAMESPACE_PF_ADM);
5285  $respuesta = $clienteWS->deleteJobs($miSoapRQ);
5286 
5287  $vRespuesta = array();
5288  if (is_object($respuesta))
5289  {
5290  $vRespuesta = $this->objectTree2array($respuesta);
5291  }
5292  return($vRespuesta);
5293  }
5294  catch (Exception $e)
5295  {
5296  // Comprobamos si estamos ante excepcion MTOM
5297  $mensaje = $e->getMessage();
5298  $mensaje = trim(strtolower($mensaje));
5299  if ($mensaje == 'looks like we got no xml document')
5300  {
5301  // Obtiene la respuesta
5302  $response = $clienteWS->__getLastResponse();
5303 
5304  // Realiza la interpretacion/sustitucion estandar de MTOM
5305  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'deleteJobsResponse');
5306  return ($vRetorno);
5307  }
5308  else
5309  {
5310  $this->tratarExcepcionEstandar($e, $clienteWS);
5311  }
5312  }
5313  }//pf_adm_deleteJobs
5314 
5315 
5329  public function pf_adm_assignJobToUser($username, $password, $jobIdentifier, $userIdentifier, $fstart, $fend) {
5330  try
5331  {
5332  $opcionesClienteWS = array (
5333  'soap_version' => SOAP_1_1, //SOAP 1.2
5334  'user_agent' => 'WSSSoapClient',
5335  'exceptions' => true,
5336  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5337  'trace' => self::$MYSOAPOP_TRACE
5338  );
5339 
5340  $this->__clienteOn(self::KEYCLIENTE_PF_ADM, true, $opcionesClienteWS);
5341  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_ADM);
5342 
5343  // Nivel de peticion
5344  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_ADM);
5345  $mainWS->append(new SoapVar($jobIdentifier, XSD_STRING, null, null,'jobIdentifier', self::$NAMESPACE_PF_ADM));
5346  $mainWS->append(new SoapVar($userIdentifier, XSD_STRING, null, null,'userIdentifier', self::$NAMESPACE_PF_ADM));
5347  $mainWS->append(new SoapVar($fstart, XSD_DATE, null, null,'fstart', self::$NAMESPACE_PF_ADM));
5348  $mainWS->append(new SoapVar($fend, XSD_DATE, null, null,'fend', self::$NAMESPACE_PF_ADM));
5349 
5350  // Realiza la peticion
5351  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'assignJobToUser', self::$NAMESPACE_PF_ADM);
5352  $respuesta = $clienteWS->assignJobToUser($miSoapRQ);
5353 
5354  $vRespuesta = array();
5355  if (is_object($respuesta))
5356  {
5357  $vRespuesta = $this->objectTree2array($respuesta);
5358  }
5359  return($vRespuesta);
5360  }
5361  catch (Exception $e)
5362  {
5363  // Comprobamos si estamos ante excepcion MTOM
5364  $mensaje = $e->getMessage();
5365  $mensaje = trim(strtolower($mensaje));
5366  if ($mensaje == 'looks like we got no xml document')
5367  {
5368  // Obtiene la respuesta
5369  $response = $clienteWS->__getLastResponse();
5370 
5371  // Realiza la interpretacion/sustitucion estandar de MTOM
5372  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'assignJobToUserResponse');
5373  return ($vRetorno);
5374  }
5375  else
5376  {
5377  $this->tratarExcepcionEstandar($e, $clienteWS);
5378  }
5379  }
5380  }//pf_adm_assignJobToUser
5381 
5382 
5394  public function pf_adm_separateJobToUser($username, $password, $jobIdentifier, $userIdentifier) {
5395  try
5396  {
5397  $opcionesClienteWS = array (
5398  'soap_version' => SOAP_1_1, //SOAP 1.2
5399  'user_agent' => 'WSSSoapClient',
5400  'exceptions' => true,
5401  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5402  'trace' => self::$MYSOAPOP_TRACE
5403  );
5404 
5405  $this->__clienteOn(self::KEYCLIENTE_PF_ADM, true, $opcionesClienteWS);
5406  $clienteWS = $this->__getClient(self::KEYCLIENTE_PF_ADM);
5407 
5408  // Nivel de peticion
5409  $mainWS = $this->pf_doAuth($username, $password, 'authentication', self::$NAMESPACE_PF_ADM);
5410  $mainWS->append(new SoapVar($jobIdentifier, XSD_STRING, null, null,'jobIdentifier', self::$NAMESPACE_PF_ADM));
5411  $mainWS->append(new SoapVar($userIdentifier, XSD_STRING, null, null,'userIdentifier', self::$NAMESPACE_PF_ADM));
5412 
5413  // Realiza la peticion
5414  $miSoapRQ = new SoapVar($mainWS, SOAP_ENC_OBJECT,null,null, 'separateJobToUser', self::$NAMESPACE_PF_ADM);
5415  $respuesta = $clienteWS->separateJobToUser($miSoapRQ);
5416 
5417  $vRespuesta = array();
5418  if (is_object($respuesta))
5419  {
5420  $vRespuesta = $this->objectTree2array($respuesta);
5421  }
5422  return($vRespuesta);
5423  }
5424  catch (Exception $e)
5425  {
5426  // Comprobamos si estamos ante excepcion MTOM
5427  $mensaje = $e->getMessage();
5428  $mensaje = trim(strtolower($mensaje));
5429  if ($mensaje == 'looks like we got no xml document')
5430  {
5431  // Obtiene la respuesta
5432  $response = $clienteWS->__getLastResponse();
5433 
5434  // Realiza la interpretacion/sustitucion estandar de MTOM
5435  $vRetorno = $this->tratarMTOM4PF($response, true, "\r\n", 'separateJobToUserResponse');
5436  return ($vRetorno);
5437  }
5438  else
5439  {
5440  $this->tratarExcepcionEstandar($e, $clienteWS);
5441  }
5442  }
5443  }//pf_adm_separateJobToUser
5444 
5445 
5446 
5447 
5448  /* ------------------------------------------------------------------------------- */
5449  /* -------------------------- Fin Subpaquete PORTAFIRMAS ------------------------- */
5450  /* ------------------------------------------------------------------------------- */
5451 
5481  public function catastro($IdPeticion, $NumElementos, $TimeStamp, $CodigoCertificado,
5482  $NifEmisor, $NombreEmisor, $CodProcedimiento, $NombreProcedimiento,
5483  $NombreCompletoFuncionario, $NifFuncionario, $IdentificadorSolicitante, $NombreSolicitante,
5484  $UnidadTramitadora, $Finalidad, $Consentimiento,
5485  $IdExpediente, $TipoDocumentacion, $Documentacion, $NombreCompleto,
5486  $Nombre, $Apellido1, $Apellido2, $CodigoCertificado, $IdSolicitud, $vDataEspecifico)
5487  {
5488  try
5489  {
5490 
5491  $opcionesClienteWS = array (
5492  'soap_version' => SOAP_1_1, //SOAP 1.2
5493  'user_agent' => 'WSSSoapClient',
5494  'exceptions' => true,
5495  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5496  'trace' => self::$MYSOAPOP_TRACE
5497  );
5498 
5499  $this->__clienteOn(self::KEYCLIENTE_CATASTRO, true, $opcionesClienteWS);
5500  $clienteWS = $this->__getClient(self::KEYCLIENTE_CATASTRO);
5501 
5502 
5503  // TODO: Sincrona
5504  $IdSolicitud = $IdPeticion;
5505 
5506  // $CodigoCertificado debería ser auto-generado
5507  // IdentificadorSolicitante = (Sugerido) CODxxxxxx
5508  // Consentimiento = Si | Ley
5509  // TipoDocumentacion = NIF | CIF | DNI | Pasaporte | NIE
5510 
5511  //$compEspecifico = new ComposerCatastro();//
5512 
5513  // Atributos
5514  $AtributosWSRequest = new ArrayObject();
5515  $AtributosWSRequest->append(new SoapVar($IdPeticion, XSD_STRING, null, null,'IdPeticion', self::$NAMESPACE_CAT_PET));
5516  $AtributosWSRequest->append(new SoapVar($NumElementos, XSD_INTEGER , null, null,'NumElementos', self::$NAMESPACE_CAT_PET));
5517  $AtributosWSRequest->append(new SoapVar($TimeStamp->format(DateTime::ATOM), XSD_STRING, null, null,'TimeStamp', self::$NAMESPACE_CAT_PET));
5518  $AtributosWSRequest->append(new SoapVar($CodigoCertificado, XSD_STRING, null, null,'CodigoCertificado', self::$NAMESPACE_CAT_PET));
5519 
5520  // Emisor
5521  $EmisorWSRequest = new ArrayObject();
5522  $EmisorWSRequest->append(new SoapVar($NifEmisor, XSD_STRING, null, null,'NifEmisor', self::$NAMESPACE_CAT_PET));
5523  $EmisorWSRequest->append(new SoapVar($NombreEmisor, XSD_STRING, null, null,'NombreEmisor', self::$NAMESPACE_CAT_PET));
5524 
5525  // Procedimiento
5526  $ProcedimientoWSRequest = new ArrayObject();
5527  $ProcedimientoWSRequest->append(new SoapVar($CodProcedimiento, XSD_STRING, null, null,'CodProcedimiento', self::$NAMESPACE_CAT_PET));
5528  $ProcedimientoWSRequest->append(new SoapVar($NombreProcedimiento, XSD_STRING, null, null,'NombreProcedimiento', self::$NAMESPACE_CAT_PET));
5529 
5530  // Funcionario
5531  $FuncionarioWSRequest = new ArrayObject();
5532  $FuncionarioWSRequest->append(new SoapVar($NombreCompletoFuncionario, XSD_STRING, null, null,'NombreCompletoFuncionario', self::$NAMESPACE_CAT_PET));
5533  $FuncionarioWSRequest->append(new SoapVar($NifFuncionario, XSD_STRING, null, null,'NifFuncionario', self::$NAMESPACE_CAT_PET));
5534 
5535  // Solicitante
5536  $SolicitanteWSRequest = new ArrayObject();
5537  $SolicitanteWSRequest->append(new SoapVar($IdentificadorSolicitante, XSD_STRING, null, null,'IdentificadorSolicitante', self::$NAMESPACE_CAT_PET));
5538  $SolicitanteWSRequest->append(new SoapVar($NombreSolicitante, XSD_STRING, null, null,'NombreSolicitante', self::$NAMESPACE_CAT_PET));
5539  $SolicitanteWSRequest->append(new SoapVar($ProcedimientoWSRequest, SOAP_ENC_OBJECT,null,null,'Procedimiento', self::$NAMESPACE_CAT_PET));
5540  $SolicitanteWSRequest->append(new SoapVar($Finalidad, XSD_STRING, null, null,'Finalidad', self::$NAMESPACE_CAT_PET));
5541  $SolicitanteWSRequest->append(new SoapVar($Consentimiento, XSD_STRING, null, null,'Consentimiento', self::$NAMESPACE_CAT_PET));
5542  $SolicitanteWSRequest->append(new SoapVar($FuncionarioWSRequest, SOAP_ENC_OBJECT,null,null,'Funcionario', self::$NAMESPACE_CAT_PET));
5543 
5544  // Titular
5545  $TitularWSRequest = new ArrayObject();
5546  $TitularWSRequest->append(new SoapVar($TipoDocumentacion, XSD_STRING, null, null,'TipoDocumentacion', self::$NAMESPACE_CAT_PET));
5547  $TitularWSRequest->append(new SoapVar($Documentacion, XSD_STRING, null, null,'Documentacion', self::$NAMESPACE_CAT_PET));
5548 
5549 
5550  // Transmision
5551  $TransmisionWSRequest = new ArrayObject();
5552  $TransmisionWSRequest->append(new SoapVar($CodigoCertificado, XSD_STRING, null, null,'CodigoCertificado', self::$NAMESPACE_CAT_PET));
5553  $TransmisionWSRequest->append(new SoapVar($IdSolicitud, XSD_STRING, null, null,'IdSolicitud', self::$NAMESPACE_CAT_PET));
5554 
5555  // DatosGenericos
5556  $DatosGenericosWSRequest = new ArrayObject();
5557  $DatosGenericosWSRequest->append(new SoapVar($EmisorWSRequest, SOAP_ENC_OBJECT,null,null,'Emisor', self::$NAMESPACE_CAT_PET));
5558  $DatosGenericosWSRequest->append(new SoapVar($SolicitanteWSRequest, SOAP_ENC_OBJECT,null,null,'Solicitante', self::$NAMESPACE_CAT_PET));
5559  $DatosGenericosWSRequest->append(new SoapVar($TitularWSRequest, SOAP_ENC_OBJECT,null,null,'Titular', self::$NAMESPACE_CAT_PET));
5560  $DatosGenericosWSRequest->append(new SoapVar($TransmisionWSRequest, SOAP_ENC_OBJECT,null,null,'Transmision', self::$NAMESPACE_CAT_PET));
5561 
5562  // SolicitudTransmision
5563  $SolicitudTransmisionWSRequest = new ArrayObject();
5564  $SolicitudTransmisionWSRequest->append(new SoapVar($DatosGenericosWSRequest, SOAP_ENC_OBJECT,null,null,'DatosGenericos', self::$NAMESPACE_CAT_PET));
5565 
5566 
5567  // Solicitudes
5568  $SolicitudesWSRequest = new ArrayObject();
5569  $SolicitudesWSRequest->append(new SoapVar($SolicitudTransmisionWSRequest, SOAP_ENC_OBJECT,null,null,'SolicitudTransmision', self::$NAMESPACE_CAT_PET));
5570 
5571  // Body
5572  $bodyWSRequest = new ArrayObject();
5573  $bodyWSRequest->append(new SoapVar($AtributosWSRequest, SOAP_ENC_OBJECT,null,null,'Atributos', self::$NAMESPACE_CAT_PET));
5574  $bodyWSRequest->append(new SoapVar($SolicitudesWSRequest, SOAP_ENC_OBJECT,null,null,'Solicitudes', self::$NAMESPACE_CAT_PET));
5575 
5576  // Envio peticion
5577  $miSoapRQ = new SoapVar($bodyWSRequest, SOAP_ENC_OBJECT,null,null,'Peticion', self::$NAMESPACE_CAT_PET);
5578 
5579  $respuesta = $clienteWS->peticionSincrona($miSoapRQ);
5580 
5581  // Respuesta
5582  $vRespuesta = array();//RABA0f8f9d62-08fc-4a8e-98e9-f23898075b37
5583  if (is_object($respuesta))
5584  {
5585  $vRespuesta = array
5586  (
5587  'respuesta' => $respuesta
5588  );
5589  }
5590  return($vRespuesta);
5591  }
5592  catch (Exception $e)
5593  {
5594  $this->tratarExcepcionEstandar($e, $clienteWS);
5595  }
5596  }//catastro
5597 
5598 
5627  public function catastroBienesPeticion($IdPeticion, $TimeStamp, $CodigoCertificado,
5628  $NifEmisor, $NombreEmisor, $CodProcedimiento, $NombreProcedimiento,
5629  $NombreCompletoFuncionario, $NifFuncionario, $IdentificadorSolicitante, $NombreSolicitante,
5630  $UnidadTramitadora, $Finalidad, $Consentimiento,
5631  $IdExpediente, $TipoDocumentacion, $Documentacion, $NombreCompleto,
5632  $Nombre, $Apellido1, $Apellido2, $CodigoCertificado, $IdSolicitud, $vDataEspecifico)
5633  {
5634  try
5635  {
5636 
5637  $opcionesClienteWS = array (
5638  'soap_version' => SOAP_1_1, //SOAP 1.2
5639  'user_agent' => 'WSSSoapClient',
5640  'exceptions' => true,
5641  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5642  'trace' => self::$MYSOAPOP_TRACE
5643  );
5644 
5645  $this->__clienteOn(self::KEYCLIENTE_CATASTRO_BIENES, true, $opcionesClienteWS);
5646  $clienteWS = $this->__getClient(self::KEYCLIENTE_CATASTRO_BIENES);
5647 
5648  /*
5649  $this->__clienteOn(self::KEYCLIENTE_CATASTRO, true);
5650  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_CATASTRO];
5651  */
5652 
5653  // Cuenta el numero de elemento
5654  $NumElementos = count($vDataEspecifico);
5655 
5656  // Atributos
5657  $AtributosWSRequest = new ArrayObject();
5658  $AtributosWSRequest->append(new SoapVar($IdPeticion, XSD_STRING, null, null,'IdPeticion', self::$NAMESPACE_CAT_PET));
5659  $AtributosWSRequest->append(new SoapVar($NumElementos, XSD_INTEGER , null, null,'NumElementos', self::$NAMESPACE_CAT_PET));
5660  $AtributosWSRequest->append(new SoapVar($TimeStamp->format(DateTime::ATOM), XSD_STRING, null, null,'TimeStamp', self::$NAMESPACE_CAT_PET));
5661  $AtributosWSRequest->append(new SoapVar($CodigoCertificado, XSD_STRING, null, null,'CodigoCertificado', self::$NAMESPACE_CAT_PET));
5662 
5663  // Solicitudes
5664  $SolicitudesWSRequest = new ArrayObject();
5665 
5666 
5667  for ($iPet=0; $iPet < $NumElementos; $iPet++) {
5668  // TODO: Sincrona
5669  $IdSolicitud = $IdPeticion . '_' . $iPet;
5670 
5671  // $CodigoCertificado debería ser auto-generado
5672  // IdentificadorSolicitante = (Sugerido) CODxxxxxx
5673  // Consentimiento = Si | Ley
5674  // TipoDocumentacion = NIF | CIF | DNI | Pasaporte | NIE
5675 
5676  $compEspecifico = new ComposerCatastro();
5677  $vDataPeticion = array( 'DatosEntrada' => $vDataEspecifico[$iPet]);
5678  $DatosEspecificosWSRequest = $compEspecifico->doIt($vDataPeticion); // $NAMESPACE_CAT_ESP
5679 
5680 
5681  // Emisor
5682  $EmisorWSRequest = new ArrayObject();
5683  $EmisorWSRequest->append(new SoapVar($NifEmisor, XSD_STRING, null, null,'NifEmisor', self::$NAMESPACE_CAT_PET));
5684  $EmisorWSRequest->append(new SoapVar($NombreEmisor, XSD_STRING, null, null,'NombreEmisor', self::$NAMESPACE_CAT_PET));
5685 
5686  // Procedimiento
5687  $ProcedimientoWSRequest = new ArrayObject();
5688  $ProcedimientoWSRequest->append(new SoapVar($CodProcedimiento, XSD_STRING, null, null,'CodProcedimiento', self::$NAMESPACE_CAT_PET));
5689  $ProcedimientoWSRequest->append(new SoapVar($NombreProcedimiento, XSD_STRING, null, null,'NombreProcedimiento', self::$NAMESPACE_CAT_PET));
5690 
5691  // Funcionario
5692  $FuncionarioWSRequest = new ArrayObject();
5693  $FuncionarioWSRequest->append(new SoapVar($NombreCompletoFuncionario, XSD_STRING, null, null,'NombreCompletoFuncionario', self::$NAMESPACE_CAT_PET));
5694  $FuncionarioWSRequest->append(new SoapVar($NifFuncionario, XSD_STRING, null, null,'NifFuncionario', self::$NAMESPACE_CAT_PET));
5695 
5696  // Solicitante
5697  $SolicitanteWSRequest = new ArrayObject();
5698  $SolicitanteWSRequest->append(new SoapVar($IdentificadorSolicitante, XSD_STRING, null, null,'IdentificadorSolicitante', self::$NAMESPACE_CAT_PET));
5699  $SolicitanteWSRequest->append(new SoapVar($NombreSolicitante, XSD_STRING, null, null,'NombreSolicitante', self::$NAMESPACE_CAT_PET));
5700  //$SolicitanteWSRequest->append(new SoapVar($UnidadTramitadora, XSD_STRING, null, null,'UnidadTramitadora', self::$NAMESPACE_CAT_PET));
5701  $SolicitanteWSRequest->append(new SoapVar($ProcedimientoWSRequest, SOAP_ENC_OBJECT,null,null,'Procedimiento', self::$NAMESPACE_CAT_PET));
5702  $SolicitanteWSRequest->append(new SoapVar($Finalidad, XSD_STRING, null, null,'Finalidad', self::$NAMESPACE_CAT_PET));
5703  $SolicitanteWSRequest->append(new SoapVar($Consentimiento, XSD_STRING, null, null,'Consentimiento', self::$NAMESPACE_CAT_PET));
5704  $SolicitanteWSRequest->append(new SoapVar($FuncionarioWSRequest, SOAP_ENC_OBJECT,null,null,'Funcionario', self::$NAMESPACE_CAT_PET));
5705  //$SolicitanteWSRequest->append(new SoapVar($IdExpediente, XSD_STRING, null, null,'IdExpediente', self::$NAMESPACE_CAT_PET));
5706 
5707  // Titular
5708  $TitularWSRequest = new ArrayObject();
5709  $TitularWSRequest->append(new SoapVar($TipoDocumentacion, XSD_STRING, null, null,'TipoDocumentacion', self::$NAMESPACE_CAT_PET));
5710  $TitularWSRequest->append(new SoapVar($Documentacion, XSD_STRING, null, null,'Documentacion', self::$NAMESPACE_CAT_PET));
5711  //$TitularWSRequest->append(new SoapVar($NombreCompleto, XSD_STRING, null, null,'NombreCompleto', self::$NAMESPACE_CAT_PET));
5712  //$TitularWSRequest->append(new SoapVar($Nombre, XSD_STRING, null, null,'Nombre', self::$NAMESPACE_CAT_PET));
5713  //$TitularWSRequest->append(new SoapVar($Apellido1, XSD_STRING, null, null,'Apellido1', self::$NAMESPACE_CAT_PET));
5714  //$TitularWSRequest->append(new SoapVar($Apellido2, XSD_STRING, null, null,'Apellido2', self::$NAMESPACE_CAT_PET));
5715 
5716  // Transmision
5717  $TransmisionWSRequest = new ArrayObject();
5718  $TransmisionWSRequest->append(new SoapVar($CodigoCertificado, XSD_STRING, null, null,'CodigoCertificado', self::$NAMESPACE_CAT_PET));
5719  $TransmisionWSRequest->append(new SoapVar($IdSolicitud, XSD_STRING, null, null,'IdSolicitud', self::$NAMESPACE_CAT_PET));
5720 
5721  // DatosGenericos
5722  $DatosGenericosWSRequest = new ArrayObject();
5723  $DatosGenericosWSRequest->append(new SoapVar($EmisorWSRequest, SOAP_ENC_OBJECT,null,null,'Emisor', self::$NAMESPACE_CAT_PET));
5724  $DatosGenericosWSRequest->append(new SoapVar($SolicitanteWSRequest, SOAP_ENC_OBJECT,null,null,'Solicitante', self::$NAMESPACE_CAT_PET));
5725  $DatosGenericosWSRequest->append(new SoapVar($TitularWSRequest, SOAP_ENC_OBJECT,null,null,'Titular', self::$NAMESPACE_CAT_PET));
5726  $DatosGenericosWSRequest->append(new SoapVar($TransmisionWSRequest, SOAP_ENC_OBJECT,null,null,'Transmision', self::$NAMESPACE_CAT_PET));
5727 
5728  // SolicitudTransmision
5729  $SolicitudTransmisionWSRequest = new ArrayObject();
5730  $SolicitudTransmisionWSRequest->append(new SoapVar($DatosGenericosWSRequest, SOAP_ENC_OBJECT,null,null,'DatosGenericos', self::$NAMESPACE_CAT_PET));
5731  $SolicitudTransmisionWSRequest->append(new SoapVar($DatosEspecificosWSRequest, SOAP_ENC_OBJECT,null,null,'DatosEspecificos', self::$NAMESPACE_CAT_ESP));
5732 
5733 
5734  // Añade la solicitud de transmision al listado de solicitudes
5735  $SolicitudesWSRequest->append(new SoapVar($SolicitudTransmisionWSRequest, SOAP_ENC_OBJECT,null,null,'SolicitudTransmision', self::$NAMESPACE_CAT_PET));
5736  }
5737 
5738  // Body
5739  $bodyWSRequest = new ArrayObject();
5740  $bodyWSRequest->append(new SoapVar($AtributosWSRequest, SOAP_ENC_OBJECT,null,null,'Atributos', self::$NAMESPACE_CAT_PET));
5741  $bodyWSRequest->append(new SoapVar($SolicitudesWSRequest, SOAP_ENC_OBJECT,null,null,'Solicitudes', self::$NAMESPACE_CAT_PET));
5742 
5743  // Envio peticion
5744  $miSoapRQ = new SoapVar($bodyWSRequest, SOAP_ENC_OBJECT,null,null,'Peticion', self::$NAMESPACE_CAT_PET);
5745  $respuesta = $clienteWS->peticionAsincrona($miSoapRQ);
5746 
5747  // Respuesta
5748  $vRespuesta = array();//RABA0f8f9d62-08fc-4a8e-98e9-f23898075b37
5749  if (is_object($respuesta))
5750  {
5751  $vRespuesta = array
5752  (
5753  'respuesta' => $respuesta
5754  );
5755  }
5756  return($vRespuesta);
5757  }
5758  catch (Exception $e)
5759  {
5760  $this->tratarExcepcionEstandar($e, $clienteWS);
5761  }
5762  }//catastroBienesPeticion
5763 
5764  public function catastroBienesRespuesta($IdPeticion, $TimeStamp, $CodigoCertificado, $NumElementos)
5765  {
5766  try
5767  {
5768 
5769  $opcionesClienteWS = array (
5770  'soap_version' => SOAP_1_1, //SOAP 1.2
5771  'user_agent' => 'WSSSoapClient',
5772  'exceptions' => true,
5773  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5774  'trace' => self::$MYSOAPOP_TRACE
5775  );
5776 
5777  $this->__clienteOn(self::KEYCLIENTE_CATASTRO_BIENES, true, $opcionesClienteWS);
5778  $clienteWS = $this->__getClient(self::KEYCLIENTE_CATASTRO_BIENES);
5779 
5780  /*
5781  $this->__clienteOn(self::KEYCLIENTE_CATASTRO, true);
5782  $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_CATASTRO];
5783  */
5784 
5785 
5786  // Atributos
5787  $AtributosWSRequest = new ArrayObject();
5788  $AtributosWSRequest->append(new SoapVar($IdPeticion, XSD_STRING, null, null,'IdPeticion', self::$NAMESPACE_CAT_SR));
5789  $AtributosWSRequest->append(new SoapVar($NumElementos, XSD_INTEGER , null, null,'NumElementos', self::$NAMESPACE_CAT_SR));
5790  $AtributosWSRequest->append(new SoapVar($TimeStamp->format(DateTime::ATOM), XSD_STRING, null, null,'TimeStamp', self::$NAMESPACE_CAT_SR));
5791  $AtributosWSRequest->append(new SoapVar($CodigoCertificado, XSD_STRING, null, null,'CodigoCertificado', self::$NAMESPACE_CAT_SR));
5792 
5793  // Body
5794  $bodyWSRequest = new ArrayObject();
5795  $bodyWSRequest->append(new SoapVar($AtributosWSRequest, SOAP_ENC_OBJECT,null,null,'Atributos', self::$NAMESPACE_CAT_SR));
5796 
5797  // Envio peticion
5798  $miSoapRQ = new SoapVar($bodyWSRequest, SOAP_ENC_OBJECT,null,null,'SolicitudRespuesta', self::$NAMESPACE_CAT_SR);
5799  $respuesta = $clienteWS->solicitudRespuesta($miSoapRQ);
5800 
5801  // Respuesta
5802  $vRespuesta = array();
5803  if (is_object($respuesta))
5804  {
5805  $vRespuesta = array
5806  (
5807  'respuesta' => $respuesta
5808  );
5809  }
5810  return($vRespuesta);
5811  }
5812  catch (Exception $e)
5813  {
5814  $this->tratarExcepcionEstandar($e, $clienteWS);
5815  }
5816  }//catastroBienesRespuesta
5817 
5818 
5819  public function catastroB($IdPeticion, $TimeStamp, $CodigoCertificado, $oSolicitud)
5820  {
5821  try
5822  {
5823 
5824  $opcionesClienteWS = array (
5825  'soap_version' => SOAP_1_1, //SOAP 1.2
5826  'user_agent' => 'WSSSoapClient',
5827  'exceptions' => true,
5828  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5829  'trace' => self::$MYSOAPOP_TRACE
5830  );
5831 
5832  $this->__clienteOn(self::KEYCLIENTE_CATASTRO, true, $opcionesClienteWS);
5833  $clienteWS = $this->__getClient(self::KEYCLIENTE_CATASTRO);
5834 
5835  // $CodigoCertificado debería ser auto-generado
5836  // IdentificadorSolicitante = (Sugerido) CODxxxxxx
5837  // Consentimiento = Si | Ley
5838  // TipoDocumentacion = NIF | CIF | DNI | Pasaporte | NIE
5839 
5840  $oCatastro = new objCatastro();
5841  $bodyWSRequest = $oCatastro->doGeneral($IdPeticion, $TimeStamp, $CodigoCertificado, $oSolicitud);
5842 
5843  // Envio peticion
5844  $miSoapRQ = new SoapVar($bodyWSRequest, SOAP_ENC_OBJECT,null,null,'Peticion', self::$NAMESPACE_CAT_PET);
5845  $respuesta = $clienteWS->peticionSincrona($miSoapRQ);
5846 
5847  // Respuesta
5848  $vRespuesta = array();//RABA0f8f9d62-08fc-4a8e-98e9-f23898075b37
5849  if (is_object($respuesta))
5850  {
5851  $vRespuesta = array
5852  (
5853  'respuesta' => $respuesta
5854  );
5855  }
5856  return($vRespuesta);
5857  }
5858  catch (Exception $e)
5859  {
5860  $this->tratarExcepcionEstandar($e, $clienteWS);
5861  }
5862  }//catastro
5863 
5864  public function catastroBienesPeticionB($IdPeticion, $TimeStamp, $CodigoCertificado, $vSolicitudes)
5865  {
5866  try
5867  {
5868 
5869  $opcionesClienteWS = array (
5870  'soap_version' => SOAP_1_1, //SOAP 1.2
5871  'user_agent' => 'WSSSoapClient',
5872  'exceptions' => true,
5873  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5874  'trace' => self::$MYSOAPOP_TRACE
5875  );
5876 
5877  $this->__clienteOn(self::KEYCLIENTE_CATASTRO_BIENES, true, $opcionesClienteWS);
5878  $clienteWS = $this->__getClient(self::KEYCLIENTE_CATASTRO_BIENES);
5879 
5880 
5881  $oCatastro = new objCatastro();
5882  $bodyWSRequest = $oCatastro->catastroBienesPeticion($IdPeticion, $TimeStamp, $CodigoCertificado, $vSolicitudes);
5883 
5884  // Envio peticion
5885  $miSoapRQ = new SoapVar($bodyWSRequest, SOAP_ENC_OBJECT,null,null, 'Peticion', self::$NAMESPACE_CAT_PET);
5886  $respuesta = $clienteWS->peticionAsincrona($miSoapRQ);
5887 
5888 
5889  // Respuesta
5890  $vRespuesta = array();//RABA0f8f9d62-08fc-4a8e-98e9-f23898075b37
5891  if (is_object($respuesta))
5892  {
5893  $vRespuesta = array
5894  (
5895  'respuesta' => $respuesta
5896  );
5897  }
5898  return($vRespuesta);
5899  }
5900  catch (Exception $e)
5901  {
5902  $this->tratarExcepcionEstandar($e, $clienteWS);
5903  }
5904  }//catastroBienesPeticion
5905 
5906  public function catastroBienesRespuestaB($IdPeticion, $TimeStamp, $CodigoCertificado, $NumElementos)
5907  {
5908  try
5909  {
5910 
5911  $opcionesClienteWS = array (
5912  'soap_version' => SOAP_1_1, //SOAP 1.2
5913  'user_agent' => 'WSSSoapClient',
5914  'exceptions' => true,
5915  'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
5916  'trace' => self::$MYSOAPOP_TRACE
5917  );
5918 
5919  $this->__clienteOn(self::KEYCLIENTE_CATASTRO_BIENES, true, $opcionesClienteWS);
5920  $clienteWS = $this->__getClient(self::KEYCLIENTE_CATASTRO_BIENES);
5921 
5922  $oCatastro = new objCatastro();
5923  $bodyWSRequest = $oCatastro->catastroBienesRespuesta($IdPeticion, $TimeStamp, $CodigoCertificado, $NumElementos);
5924 
5925  // Envio peticion
5926  $miSoapRQ = new SoapVar($bodyWSRequest, SOAP_ENC_OBJECT,null,null,'SolicitudRespuesta', self::$NAMESPACE_CAT_SR);
5927  $respuesta = $clienteWS->solicitudRespuesta($miSoapRQ);
5928 
5929  // Respuesta
5930  $vRespuesta = array();
5931  if (is_object($respuesta))
5932  {
5933  $vRespuesta = array
5934  (
5935  'respuesta' => $respuesta
5936  );
5937  }
5938  return($vRespuesta);
5939  }
5940  catch (Exception $e)
5941  {
5942  $this->tratarExcepcionEstandar($e, $clienteWS);
5943  }
5944  }//catastroBienesRespuestaB
5945 
5946 
5947 }//Fin WSComunClient
5948 
5949 
5950 
5951 
5952 ?>
eliminarDocumentoGDE($codApp, $refDoc)
establecerMetadatoCarpetasPersonalizadosGDE2($codApp, $path, $vColMetadatosPers)
eliminarCarpetaGDE2($codApp, $path)
obtenerExpedienteENIdeCarpetaGDE2($codApp, $path, $idCertificadoSafe=null, $idSesionSafe=null)
pf_adm_updateEnhancedJobs($username, $password, $enhancedJobList)
pf_adm_separateJobToUser($username, $password, $jobIdentifier, $userIdentifier)
pf_queryEnhancedJobs($username, $password, $queryJob, $querySeat)
obtenerDocumentoGDE2($codApp, $refDoc, $parcial='1')
eliminarDocumentoGDE2($codApp, $refDoc)
retornaTodasAutorizacionesDNIWS($usuarioDNI, $tipoBusqueda)
eliminarCarpetaGDE($codApp, $path)
autenticaUsuarioLDAPWS($user, $pass)
pf_downloadDocument($username, $password, $documentId)
castellanoValenciano($texto)
static numberBaseConvert($numstring, $frombase=10, $tobase=16)
generarIdentificadorENIGDE2($codApp)
const TIPOBUSQUEDA_USUARIO
pf_mod_deleteSigners($username, $password, $requestId, $signerList)
pf_mod_deleteRequest($username, $password, $requestId)
const KEYCLIENTE_AUTENTICA
getInformacionLDAP($user, $pass)
pf_adm_insertEnhancedUsers($username, $password, $enhancedUserList)
insertarDocumentoENIGDE2($codApp, $docContentB64, $nombreDoc, $pathDoc=null, $tipo=null, $vMetaENI=null, $vMetaPers=null, $vFirmas=null)
firmarCertificadoServer($idSession, $idCertificado, $docContentB64, $tipoDoc='TF06')
autenticaConFirmaWS($firmaB64, $codigoEntidad=null)
pf_adm_updateEnhancedUsers($username, $password, $enhancedUserList)
pf_mod_insertDocument($username, $password, $requestId, $document)
setKeyFile($pathKey)
array2ObjectTree($array)
buscarDocCriterioPaginadoGDE2($codApp, $registrosPagina, $pagina, $filtroPath=null, $buscarInTree=null, $operacion=null, $coleccionCriterios=null)
retornaAutorizacionWS($usuarioHDFI, $idAplicacion)
retornaTodasAutorizacionesWS($usuarioHDFI)
pf_adm_deleteJobs($username, $password, $jobIdentifierList)
crearCarpetaGDE2($codApp, $path, $tipo=null, $metadatosExpedienteEni=null, $coleccionMetadatosPersonalizados=null)
pf_mod_removeRequest($username, $password, $requestId, $removingMessage)
pf_queryRequest($username, $password, $requestId)
pf_mod_deleteDocument($username, $password, $documentId)
pf_mod_createRequest($username, $password, $request)
pf_queryImportanceLevels($username, $password, $query)
pf_mod_insertSigners($username, $password, $requestId, $signLine, $signerList, $signLineType)
__construct($v_wsdl, $v_datosCertif, $idAPP=null)
buscarDocCriterioGDE2($codApp, $filtroPath=null, $buscarInTree=null, $operacion=null, $coleccionCriterios=null)
pf_adm_deleteUsers($username, $password, $userIdentifierList)
pf_mod_sendRequest($username, $password, $requestId)
pf_queryStates($username, $password, $query)
pf_queryDocumentTypes($username, $password, $query)
loadTracertPAI($vTrazabilidadPAI)
pf_downloadSign($username, $password, $documentId)
insertarDocumentoGDE($codApp, $docContentB64, $nombreDoc, $pathDoc='', $vMetadatosENI=null, $vMetadatosPersonalizados=null)
obtenerDocumentoGDE($codApp, $refDoc, $parcial='1')
pf_queryJobs($username, $password, $query)
valencianoCastellano($texto)
empaquetarDocumentoENIGDE2($codApp, $contenido, $vMetadatosEni, $vFirmas)
tratarMTOMEstandar($response, $itemToReturn=null)
insertarDocumentoGDE2($codApp, $docContentB64, $nombreDoc, $pathDoc=null, $tipo=null, $vMetadatosENI=null, $vMetadatosPersonalizados=null, $vFirmas=null)
generarTokenGDE2($codApp, $vRefDoc)
pf_mod_updateRequest($username, $password, $request)
catastro($IdPeticion, $NumElementos, $TimeStamp, $CodigoCertificado, $NifEmisor, $NombreEmisor, $CodProcedimiento, $NombreProcedimiento, $NombreCompletoFuncionario, $NifFuncionario, $IdentificadorSolicitante, $NombreSolicitante, $UnidadTramitadora, $Finalidad, $Consentimiento, $IdExpediente, $TipoDocumentacion, $Documentacion, $NombreCompleto, $Nombre, $Apellido1, $Apellido2, $CodigoCertificado, $IdSolicitud, $vDataEspecifico)
pf_adm_assignJobToUser($username, $password, $jobIdentifier, $userIdentifier, $fstart, $fend)
pf_queryEnhancedUserJobAssociatedToUser($username, $password, $userIdentifier)
getInformacionHDFI($user, $pass)
obtenerDocumentoENIGDE2($codApp, $refDoc)
establecerMetadatosENIGDE2($codApp, $refDoc, $vMetadatosEni)
getInformacionWS($token)
establecerMetadatosCarpetaExpedienteENIGDE2($codApp, $path, $vMetadatosExpedienteEni)
pf_querySeats($username, $password, $query)
establecerMetadatosPersonalizadosGDE2($codApp, $refDoc, $coleccionMetadatosPersonalizados)
setPassPhrase($passphrase)
pf_querySign($username, $password, $documentId)
setCertFile($pathCert)
pf_queryUsers($username, $password, $query)
catastroBienesPeticion($IdPeticion, $TimeStamp, $CodigoCertificado, $NifEmisor, $NombreEmisor, $CodProcedimiento, $NombreProcedimiento, $NombreCompletoFuncionario, $NifFuncionario, $IdentificadorSolicitante, $NombreSolicitante, $UnidadTramitadora, $Finalidad, $Consentimiento, $IdExpediente, $TipoDocumentacion, $Documentacion, $NombreCompleto, $Nombre, $Apellido1, $Apellido2, $CodigoCertificado, $IdSolicitud, $vDataEspecifico)
pf_queryEnhancedUserJobAssociatedToJob($username, $password, $jobIdentifier)
pf_queryEnhancedUsers($username, $password, $queryUser, $querySeat)
setDebugMode($activo)
pf_adm_insertEnhancedJobs($username, $password, $enhancedJobList)
obtenerExpedienteENIGDE2($codApp, $refDoc, $vMetadatosExpedienteEni, $idCertificadoSafe=null, $idSesionSafe=null)
autenticaUsuarioWS($user, $pass)
setWSDLTimeOut($segs)
asociarFirmasGDE2($codApp, $refDoc, $vFirmas)