<?php
include_once('nusoap/lib/nusoap.php');
$client = new soapclient('http://sdk2.entinfo.cn/webservice.asmx?wsdl',true); 
$client->soap_defencoding = 'GB2312';
$client->decode_utf8 = false;
$sn='SDK-BBX-010-XXXXX';
$password='XXXXX';
$pwd=strtoupper(md5($sn.$password));
$mobile=$_REQUEST['mobile'];//手机号
$content=$_REQUEST['content'];//内容
$ext=$_REQUEST['ext'];//扩展码，可为空
$stime=$_REQUEST['stime'];//定时时间,可为空
$rrid=$_REQUEST['rrid'];//唯一标志码，如果为空，将返回系统生成的标志码
//发送短信
$parameters=array("sn"=>$sn,"pwd"=>$pwd,"mobile"=>$mobile,"content"=>$content,"ext"=>$ext,"stime"=>$stime,"rrid"=>$rrid);
$str=$client->call('mt',array('parameters' =>$parameters), '', '', false, true,'document','encoded'); 
echo "所有的返回值均需要判断才可以认定是否成功或者 判断方法为: 返回值非空或者不是以负号开头便是成功.";
if (!$err=$client->getError()) {
    echo " 发送返回值(是否成功需要判断) :";
    print_r($str);
} else { 
    echo " 错误 :",$err;
}
//查询余额
$parameters=array("sn"=>$sn,"pwd"=>$pwd);
$str=$client->call('balance',array('parameters' =>$parameters), '', '', false, true,'document','encoded'); 
if (!$err=$client->getError()) {
    echo " 余额为 :";
    print_r($str);
} else { 
    echo " 错误 :",$err;
}

//修改密码
$parameters=array("sn"=>$sn,"pwd"=>$password,"newpwd"=>"此处为新的密码");
$str=$client->call('UDPPwd',array('parameters' =>$parameters), '', '', false, true,'document','encoded'); 
if (!$err=$client->getError()) {
    echo " 修改密码 :";
    print_r($str);
} else { 
    echo " 错误 :",$err;
}

?>
