<soap:envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:body>
<acceptleadresponse xmlns="http://tempuri.org/WhiteBox/Lead">
<acceptleadresult>
<purchase>false</purchase>
<rejectreason>Duplicate Lead</rejectreason>
<tier>0</tier>
<starttime>2013-09-05T18:15:32.1757337-05:00</starttime>
<endtime>2013-09-05T18:15:32.2693339-05:00</endtime>
<redirect>https://www1.paydaymate.com.au/Account/Sorry</redirect>
</acceptleadresult>
</acceptleadresponse>
</soap:body>
</soap:envelope>
我需要获得两个节点,重定向和购买。但所有值也可以(foreach)。我尝试使用命名空间,但实际上我无处可去
$xml = simplexml_load_string($response['response'], NULL, NULL, "http://schemas.xmlsoap.org/soap/envelope/");
//print_r($xml);
$xml->registerXPathNamespace('soap', 'http://schemas.xmlsoap.org/soap/envelope/');
foreach($xml->xpath('//acceptleadresponse') as $header){
var_export($header->xpath('//acceptleadresult'));
}