私は解析しようとしているSOAP応答を持っていますが、エラーが発生しているようです。SOAP応答の解析PHP
SOAP応答:
Trying to get property of non-object
Iはまた、次のコードを試みた:
$doc = new DOMDocument();
$doc->loadXML($strXml);
echo $doc->getElementsByTagName('Status')->item(0)->nodeValue;
これは、次のエラーが生成さ:
私は、次のコードを試みた<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<ValidateNewUserResponse xmlns="urn:websitea.com/v2"><ValidateNewUserResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><Message i:nil="true"/>
<Status>true</Status>
<FailureReason>None</FailureReason>
<IdentityValidationOutcome>0</IdentityValidationOutcome>
<ValidationIdentifier>112244</ValidationIdentifier>
</ValidateNewUserResult></ValidateNewUserResponse>
</s:Body>
</s:Envelope>
次のエラー生成3210
:
simplexml_load_string(): namespace error : Namespace prefix i for nil on Message is not defined
可能な複製(http://stackoverflow.com/questions/26467445/domdocument-simple-getelementsbytagname:あなたのコードは、次の(一重引用符を使用して)私のために働いたのテスト-wont-work) –