好的,首先让我向您展示我的脚本。
<?php
$soap_exception_occured = false;
$wsdl_path = 'http://vrapi.xyz.com/?wsdl';
$response = '';
ini_set('soap.wsdl_cache_enabled', '0'); // disabling WSDL cache
try {
$client = new SoapClient($wsdl_path);
}
catch(SoapFault $exception) {
$soap_exception_occured = true;
$response .= '\nError occoured when connecting to the SMS SOAP Server!';
$response .= '\nSoap Exception: '.$exception;
}
/* Create a Recharge at VR */
$client_id = 'appl45fgysssl';
$balance_info = new stdClass();
try {
$balance_info = $client->GetBalanceInfo($client_id);
}
catch(SoapFault $exception) {
$soap_exception_occured = true;
$response .= "\nError occoured at method GetBalanceInfo($client_id)";
$response .= "\nSoap Exception: ".$exception;
}
/* Do something or print results */
if($soap_exception_occured || $balance_info==null) echo $response;
else print_r($balance_info);
?>
并在浏览器中输出
stdClass Object ( [client_user_id] => appl45fgysssl [available_credit] => 9755 [last_updated_time] => 2012-07-29 14:30:15 )
我想以排列良好的格式显示数据。前任。
客户端:appl45fgysssl
余额:9755
时间:2012-07-29 14:30:15
请帮我这样做。任何参考对我来说都应该没问题。