简介:这是PHP中如何调用webservice的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。
class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=327014' scrolling='no'> 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; } ?>