Ver Mensaje Individual
  #3 (permalink)  
Antiguo 14/11/2013, 08:37
Avatar de Tollelle
Tollelle
 
Fecha de Ingreso: enero-2005
Mensajes: 64
Antigüedad: 19 años, 3 meses
Puntos: 0
Respuesta: cURL y parseado XML no legible

Gracias por el aporte, también lo intenté y nada...

Detalle curioso:

Al hacer un var_dump($respuesta) sobre lo que me devuelve tal cual el webservice obtengo lo siguiente:
Código PHP:
Ver original
  1. string(619) "<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header/><soapenv:Body><trataPeticionPagoResponse xmlns="http://webservices.tpvpc.sermepa.es"><trataPeticionPagoReturn>&lt;Operaciones&gt;&lt;Error&gt;&lt;codigo&gt;COD-00000&lt;/codigo&gt;&lt;mensaje&gt;Mensaje de error del sistema&lt;/mensaje&gt;&lt;/Error&gt;&lt;/Operaciones&gt;</trataPeticionPagoReturn></trataPeticionPagoResponse></soapenv:Body></soapenv:Envelope>"
Nótese que hay xml a pelo y xml codificado a entities... 0_o

Lo que no consigo es obtener el <trataPeticionPagoReturn> para pasarle el html_entity_decode() a su contenido y así poder leerlo como objeto... :/

El mismo webservice consumido desde SOAP con PHP me devuelve lo siguiente al hacer un var_dump($respuesta) en XML sin problemas:
Código PHP:
Ver original
  1. object(stdClass)#3 (1) {
  2.  ["trataPeticionPagoReturn"]=>
  3.   string(123) "COD-00000Mensaje de error del sistema"
  4. }

En cURL haciendo un var_dump(simplexml_load_string(html_entity_decode( $respuesta))) me tira:
Código PHP:
Ver original
  1. object(SimpleXMLElement)#1 (0) {
  2. }

Gracias de todas formas.