第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

soap xml 響應(yīng) - 如何獲取頑固的數(shù)據(jù)

soap xml 響應(yīng) - 如何獲取頑固的數(shù)據(jù)

PHP
牛魔王的故事 2021-06-17 18:10:02
我正在嘗試獲取faultstring元素的內(nèi)容,而且我更習(xí)慣于 SimpleXML 的對(duì)象語(yǔ)法 ( $xml->...->faultstring.) 下面的 DomDocument 方法有效,但我更愿意堅(jiān)持使用 SimpleXML。PHP 版本 5.6.40,Libxml 2.9.1。$xmlResponse = '<?xml version="1.0" encoding="utf-8"?>    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">        <soap:Body>            <soap:Fault>                <faultcode>soap:Client</faultcode>                <faultstring>Server did not recognize the value of HTTP Header SOAPAction: https://gw1.domain.com:4430/.</faultstring>                <detail />            </soap:Fault>        </soap:Body>    </soap:Envelope>';// DOES NOT WORK$xml = simplexml_load_string($xmlResponse,NULL,NULL,"http://schemas.xmlsoap.org/soap/envelope/");$faultstring = (string) ($xml->Body->Fault->faultstring);var_dump($faultstring);// WORKS$_DomObject = new DOMDocument;$_DomObject->loadXML($xmlResponse);if (!$_DomObject) die("Error while parsing the document");$s = simplexml_import_dom($_DomObject);foreach(['faultcode','faultstring','detail'] as $tag) {    echo $tag.' => '.$_DomObject->getElementsByTagName($tag)[0]->textContent.'<br/>';}
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 158 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)