__getLastResponse不返回XML

时间:2014-07-16 07:15:09

标签: php xml

我有以下问题:无法检索XML响应。 php变量$ lists中的响应很好,但是当我尝试使用_getLastResponse获取XML形式的响应时,没有显示XML。

代码是

<?php
    $url = "http://www.onlinekartago.ro/ReservationWSTest/Offer.asmx?WSDL";
    $user = 'KartagoTest';
    $pass = 'KartagoTestPassword';
    try {
        $client_K = new SoapClient($url, array('trace' => 1));
    } catch (SoapFault $exception) {        throw $exception;   }
    $params = array('user'=>array('UserName'=>$user, 'Password'=>$pass),'cultureID'=>1); 
    $lists=$client_K->GetBaseListsAll($params);
//  print_r($lists);
    echo "Response:\n".$client_K->__getLastResponse()."\n Print_r:";
?>

我还尝试了跟踪的“TRUE”值,但结果相同。有什么建议吗?

1 个答案:

答案 0 :(得分:0)

echo "Response:\n" . htmlentities(str_ireplace('><', ">\n<", $client->__getLastResponse())) . "\n";