我得到以下肥皂响应。
<soapenv>
<soapenv:Body><res:ResultMsg >
<Result>
<ResultType>0</ResultType>
<ResultCode>0</ResultCode>
<ResultDesc>Processing</ResultDesc>
<OriginatorID>2545imt56764</OriginatorID>
<ResultParameters>
<ResultParameter>
<Key>firstname</Key>
<Value>john</Value>
</ResultParameter>
<ResultParameter>
<Key>lastname</Key>
<Value>doe</Value>
</ResultParameter>
<ResultParameter>
<Key>Country</Key>
<Value>xxxx</Value>
</ResultParameter>
</ResultParameters>
</Result>
</res:ResultMsg>
</soapenv:Body>
</soapenv:Envelope>
我想从代码中检索名字和姓氏。以下是我正在使用的代码。
$doc->loadXML($rawXML);
$ResultCode = $doc->getElementsByTagName('ResultCode')->item(0)->nodeValue;
$ResultDesc = $doc->getElementsByTagName('ResultDesc')->item(0)->nodeValue;
$OriginatorID = $doc->getElementsByTagName('OriginatorID')->item(0)->nodeValue;
$name = $doc->getElementsByTagName('value')->item(0)->nodeValue;
echo $ResultCode"," ;
echo $ResultDesc"," ;
echo $OriginatorID",";
echo $name",";
我如何能够检索姓氏和国家/地区值