首頁  >  文章  >  後端開發  >  请高手帮忙看一下,如何取出返回的XML的值

请高手帮忙看一下,如何取出返回的XML的值

WBOY
WBOY原創
2016-06-23 14:14:38894瀏覽

header("Content-Type:text/html;   charset=utf-8");
error_reporting(E_ALL ^ E_NOTICE);

ob_start();
require_once('lib/nusoap.php');

$url ="http://wingcyx.gicp.net:1600/WeChatSrv.asmx?wsdl";
$client = new nusoap_client($url, 'wsdl','','','','');
$client->soap_defencoding='utf-8';
$client->decode_utf8=false;
$client->xml_encoding='utf-8';
//参数转换为数组传递
$ary = array('WeChat' => 'wingcyx', 'mobile' => '13670500598');
$result = $client->call('regmember',$ary);
$result =get_object_vars($result);

echo $result->regmemberResult;

?>


回复讨论(解决方案)

建议直接上返回的全部内容

试过很多种方法,除了var_dump().直接指向数组也是不行,不知道咋整

<?phpheader("Content-Type:text/html;   charset=utf-8");error_reporting(E_ALL ^ E_NOTICE);ob_start();require_once('lib/nusoap.php');$url ="http://wingcyx.gicp.net:1600/WeChatSrv.asmx?wsdl";$client = new nusoap_client($url, 'wsdl','','','','');$client->soap_defencoding='utf-8';$client->decode_utf8=false;$client->xml_encoding='utf-8';//参数转换为数组传递$ary = array('WeChat' => 'wingcyx', 'mobile' => '13670500598');$result = $client->call('regmember',$ary);//$result =get_object_vars($result);$doc = new DOMDocument();$doc->loadXML($result['regmemberResult']);echo $doc->getElementsByTagName('CardId')->item(0)->nodeValue;

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn