41 public function insertarDocumentoGDE($codApp, $docContentB64, $nombreDoc, $pathDoc=
'', $vMetadatosENI=null, $vMetadatosPersonalizados=null)
46 $clienteWS = $this->v_clienteWS[self::KEYCLIENTE_GDE];
50 $insertarDocumentoWSRequest->append(
new SoapVar($codApp, XSD_STRING, null, null,
'codigoAplicacion', self::$NAMESPACE_GDE));
53 $peticionWSRequest->append(
new SoapVar($docContentB64, XSD_STRING, null, null,
'contenido', self::$NAMESPACE_GDE));
54 $peticionWSRequest->append(
new SoapVar($nombreDoc, XSD_STRING, null, null,
'nombre', self::$NAMESPACE_GDE));
58 $peticionWSRequest->append(
new SoapVar($pathDoc, XSD_STRING, null, null,
'path', self::$NAMESPACE_GDE));
61 $insertarDocumentoWSRequest->append(
new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,
'peticion', self::$NAMESPACE_GDE));
62 $miSoapRQ =
new SoapVar($insertarDocumentoWSRequest, SOAP_ENC_OBJECT,null,null,
'insertarDocumento', self::$NAMESPACE_GDE);
63 $respuesta = $clienteWS->insertarDocumento($miSoapRQ);
66 if (is_array($vMetadatosENI))
69 $peticionWSRequest->append(
new SoapVar($objMetadatosENI, SOAP_ENC_OBJECT, null, null,
'metadatosENI', self::$NAMESPACE_GDE));
73 if (is_array($vMetadatosPersonalizados))
75 $objMetadatosPersonalizados = $this->
array2ObjectTree($vMetadatosPersonalizados);
76 $peticionWSRequest->append(
new SoapVar($objMetadatosPersonalizados, SOAP_ENC_OBJECT, null, null,
'coleccionMetadatosPersonalizados', self::$NAMESPACE_GDE));
79 $vRespuesta = array();
80 if (is_object($respuesta))
84 'referenciaDocumento' =>$respuesta->respuesta->referenciaDocumento,
85 'nombre' => $respuesta->respuesta->nombre
94 $this->
addDebugInfo(__CLASS__.
':'.__METHOD__.
'['.__FILE__.
'-'.__LINE__.
']'.
"\n");
95 if (is_object($clienteWS))
97 $this->
addDebugInfo(
"RqH:\n ".$clienteWS->__getLastRequestHeaders());
98 $this->
addDebugInfo(
"Rq:\n ".$clienteWS->__getLastRequest());
99 $this->
addDebugInfo(
"RsH:\n ".$clienteWS->__getLastResponse());
100 $this->
addDebugInfo(
"Rs:\n ".$clienteWS->__getLastResponseHeaders());
127 $opcionesClienteWS = array (
128 'soap_version' => SOAP_1_1,
129 'user_agent' =>
'WSSSoapClient',
130 'exceptions' =>
true,
131 'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
132 'trace' => self::$MYSOAPOP_TRACE
135 $this->
__clienteOn(self::KEYCLIENTE_GDE,
true, $opcionesClienteWS);
137 $clienteWS = $this->
__getClient(self::KEYCLIENTE_GDE);
140 $obtenerDocumentoWSRequest->append(
new SoapVar($codApp, XSD_STRING, null, null,
'codigoAplicacion', self::$NAMESPACE_GDE));
143 $peticionWSRequest->append(
new SoapVar($refDoc, XSD_STRING, null, null,
'referenciaDocumento', self::$NAMESPACE_GDE));
144 $peticionWSRequest->append(
new SoapVar($parcial, XSD_STRING, null, null,
'parcial', self::$NAMESPACE_GDE));
145 $obtenerDocumentoWSRequest->append(
new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,
'peticion', self::$NAMESPACE_GDE));
147 $miSoapRQ =
new SoapVar($obtenerDocumentoWSRequest, SOAP_ENC_OBJECT,null,null,
'obtenerDocumento', self::$NAMESPACE_GDE);
148 $respuesta = $clienteWS->obtenerDocumento($miSoapRQ);
150 $vRespuesta = array();
151 if (is_object($respuesta))
160 $mensaje = $e->getMessage();
161 $mensaje = trim(strtolower($mensaje));
162 if ($mensaje ==
'looks like we got no xml document')
164 $response = $clienteWS->__getLastResponse();
170 $this->
addDebugInfo(__CLASS__.
':'.__METHOD__.
'['.__FILE__.
'-'.__LINE__.
']'.
"\n");
171 if (is_object($clienteWS))
173 $this->
addDebugInfo(
"RqH:\n ".$clienteWS->__getLastRequestHeaders());
174 $this->
addDebugInfo(
"Rq:\n ".$clienteWS->__getLastRequest());
175 $this->
addDebugInfo(
"RsH:\n ".$clienteWS->__getLastResponse());
176 $this->
addDebugInfo(
"Rs:\n ".$clienteWS->__getLastResponseHeaders());
202 $opcionesClienteWS = array (
203 'soap_version' => SOAP_1_1,
204 'user_agent' =>
'WSSSoapClient',
205 'exceptions' =>
true,
206 'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
207 'trace' => self::$MYSOAPOP_TRACE
210 $this->
__clienteOn(self::KEYCLIENTE_GDE,
true, $opcionesClienteWS);
212 $clienteWS = $this->
__getClient(self::KEYCLIENTE_GDE);
215 $obtenerDocumentoWSRequest->append(
new SoapVar($codApp, XSD_STRING, null, null,
'codigoAplicacion', self::$NAMESPACE_GDE));
218 $peticionWSRequest->append(
new SoapVar($refDoc, XSD_STRING, null, null,
'referenciaDocumento', self::$NAMESPACE_GDE));
219 $obtenerDocumentoWSRequest->append(
new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,
'peticion', self::$NAMESPACE_GDE));
221 $miSoapRQ =
new SoapVar($obtenerDocumentoWSRequest, SOAP_ENC_OBJECT,null,null,
'eliminarDocumento', self::$NAMESPACE_GDE);
222 $respuesta = $clienteWS->eliminarDocumento($miSoapRQ);
224 $vRespuesta = array();
225 if (is_object($respuesta))
233 $mensaje = $e->detail->ExcepcionWS->detalleError;
234 $mensaje = trim(strtolower($mensaje));
235 if (strpos($mensaje,
'ya estaba borrado')===
false)
239 $this->
addDebugInfo(__CLASS__.
':'.__METHOD__.
'['.__FILE__.
'-'.__LINE__.
']'.
"\n");
240 if (is_object($clienteWS))
242 $this->
addDebugInfo(
"RqH:\n ".$clienteWS->__getLastRequestHeaders());
243 $this->
addDebugInfo(
"Rq:\n ".$clienteWS->__getLastRequest());
244 $this->
addDebugInfo(
"RsH:\n ".$clienteWS->__getLastResponse());
245 $this->
addDebugInfo(
"Rs:\n ".$clienteWS->__getLastResponseHeaders());
252 return array(
'correcto'=>
false);
272 $opcionesClienteWS = array (
273 'soap_version' => SOAP_1_1,
274 'user_agent' =>
'WSSSoapClient',
275 'exceptions' =>
true,
276 'cache_wsdl' => self::$MYSOAPOP_WSDL_CACHE,
277 'trace' => self::$MYSOAPOP_TRACE
280 $this->
__clienteOn(self::KEYCLIENTE_GDE,
true, $opcionesClienteWS);
282 $clienteWS = $this->
__getClient(self::KEYCLIENTE_GDE);
285 $obtenerDocumentoWSRequest->append(
new SoapVar($codApp, XSD_STRING, null, null,
'codigoAplicacion', self::$NAMESPACE_GDE));
288 $peticionWSRequest->append(
new SoapVar($path, XSD_STRING, null, null,
'path', self::$NAMESPACE_GDE));
289 $obtenerDocumentoWSRequest->append(
new SoapVar($peticionWSRequest, SOAP_ENC_OBJECT,null,null,
'peticion', self::$NAMESPACE_GDE));
291 $miSoapRQ =
new SoapVar($obtenerDocumentoWSRequest, SOAP_ENC_OBJECT,null,null,
'eliminarCarpeta', self::$NAMESPACE_GDE);
292 $respuesta = $clienteWS->eliminarCarpeta($miSoapRQ);
294 $vRespuesta = array();
295 if (is_object($respuesta))
305 $this->
addDebugInfo(__CLASS__.
':'.__METHOD__.
'['.__FILE__.
'-'.__LINE__.
']'.
"\n");
306 if (is_object($clienteWS))
308 $this->
addDebugInfo(
"RqH:\n ".$clienteWS->__getLastRequestHeaders());
309 $this->
addDebugInfo(
"Rq:\n ".$clienteWS->__getLastRequest());
310 $this->
addDebugInfo(
"RsH:\n ".$clienteWS->__getLastResponse());
311 $this->
addDebugInfo(
"Rs:\n ".$clienteWS->__getLastResponseHeaders());
obtenerDocumentoGDE($codApp, $refDoc, $parcial='1')
tratarMTOMEstandar($response, $itemToReturn=null)
eliminarDocumentoGDE($codApp, $refDoc)
eliminarCarpetaGDE($codApp, $path)
__clienteOn($tipo, $trazabilidadPai=true, $opcionesClienteWS=null)
insertarDocumentoGDE($codApp, $docContentB64, $nombreDoc, $pathDoc='', $vMetadatosENI=null, $vMetadatosPersonalizados=null)