当前位置:Gxlcms > PHP教程 > 请高手帮忙看一下,怎么取出返回的XML的值

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

时间:2021-07-01 10:21:17 帮助过:10人阅读

请高手帮忙看一下,如何取出返回的XML的值
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;

?>

分享到:


------解决方案--------------------

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);

$doc = new DOMDocument();
$doc->loadXML($result['regmemberResult']);
echo $doc->getElementsByTagName('CardId')->item(0)->nodeValue;

人气教程排行