<err:Errors>
以下のSOAPにある内部に入ろうとしています。
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<soapenv:Fault>
<faultcode>Client</faultcode>
<faultstring>An exception has been raised as a result of client data.</faultstring>
<detail>
<err:Errors xmlns:err="http://www.ups.com/XMLSchema/XOLTWS/Error/v1.1">
<err:ErrorDetail>
<err:Severity>Hard</err:Severity>
<err:PrimaryErrorCode>
<err:Code>120802</err:Code>
<err:Description>Address Validation Error on ShipTo address</err:Description>
</err:PrimaryErrorCode>
</err:ErrorDetail>
</err:Errors>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
これが私がやろうとしている方法ですが、 $fault_errors->Errors には何もありません。
$nameSpaces = $xml->getNamespaces(true);
$soap = $xml->children($nameSpaces['soapenv']);
$fault_errors = $soap->Body->children($nameSpaces['err']);
if (isset($fault_errors->Errors)) {
$faultCode = (string) $fault_errors->ErrorDetail->PrimaryErrorCode->Code;
}