肥皂xml访问属性

时间:2018-09-03 22:20:16

标签: php xml soap

我正在尝试从xml <Numberor Result="N">1213213123213</Numberor>中访问Result属性值

到目前为止,我已经有了此代码

$xml = simplexml_load_string($response, NULL, NULL, "http://xml.apache.org/xml-soap");
$soap= (string)$xml->children('soapenv', true)->Body->children()
()->WashNumbersResponse->WashNumbersReturn->NumbersSubmitted->Numberor

下面是xml响应,我将非常感谢对此的帮助

<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:WashNumbersResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://rtw.dncrtelem">
  <WashNumbersReturn xsi:type="ns2:Document" xmlns:ns2="http://xml.apache.org/xml-soap">
    <NumbersSubmitted Points="0" ClientReferenceId="007" ErrorCode="0" FinishDate="2018-09-03 09:12:49:1" twichId="9" TransactionId="75526416" RexUserId="0">
      <Numberor Result="N">1213213123213</Numberor>
      <Numberor Result="Y">5486876876</Numberor>
      <Numberor Result="I">9999945464654</Numberor>
    </NumbersSubmitted>
  </WashNumbersReturn>
</ns1:WashNumbersResponse>

0 个答案:

没有答案
相关问题