Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/06/2009, 12:03
Avatar de Synkronice
Synkronice
 
Fecha de Ingreso: octubre-2007
Ubicación: Madrid
Mensajes: 831
Antigüedad: 16 años, 7 meses
Puntos: 48
Respuesta: Como obtener un RESPONSE como xml

Pon tu...

Código PHP:
header ("Content-type:text/xml"); 
...antes de pintar la salida, por ejemplo al principio del código....

Código PHP:
<?php
// header lo primero de todo
header ("Content-type:text/xml");

$reqestPayloadString = <<<XML
<ns1:getProductos xmlns:ns1="...php.wsf.wso2.net/samples">
        <ns1:id_producto>1</ns1:id_producto>
</ns1:getProductos>
XML;

try
{
        
$message = new WSMessage($reqestPayloadString
                array(
"to" =>  ".../~li406045162/php/ws/wsf/wsf_lib/productoDataSer
vice2.php"
));
        
        
$client = new WSClient(array("useSOAP"=>1.1));
        
$response $client->request($message);
        echo 
$response->str;
        echo 
"\n";
}
catch (
Exception $e
{
        
        if (
$e instanceof WSFault
        {
            
$fault $e;
                
printf("Soap Fault received with code '%s' and reason '%s'\n"
                        
$fault->code$fault->reason);
        }
        else 
        {
                
printf("Exception caught with message '%s'\n"$e->getMessage());
        }
}
?>