PHP中调用webservice
<?php $info = new StdClass(); $info->checkword = ''; $info->mobileno = '15013882539'; $info->msg = 'love asdflkj'; $info->msgtype = 'ECP'; $info->resno = 'SF'; $param=array($info); $wsdl = "http://192.168.32.97:7001/WebMDSMS/services/procSMS?wsdl"; $cliente = new SoapClient($wsdl); $vem = $cliente->__call('sendSMS',$param); print $vem; ?>
nusoap调用webservice
<?php require("./lib/nusoap.php"); $info = new StdClass(); $info->checkword = ''; $info->mobileno = '15013882539'; $info->msg = 'love asdflkj'; $info->msgtype = 'ECP'; $info->resno = 'SF'; $param=array($info); $client = new nusoap_client('http://192.168.32.97:7001/WebMDSMS/services/procSMS?wsdl', true); $str=$client->call("sendSMS",$param); if (!$client->getError()) { echo " 程序返回 :".$str; } else{ echo " 错误 :".$err; } ?>