header("Content-Type: text/html; charset=utf-8");
require_once("lib/nusoap.php");
// 要访问的webservice路径
$NusoapWSDL="http://localhost:8080/myWebService/services/SendMoblieMsg?wsdl";
// 生成客户端对象
$client = new soapclient($NusoapWSDL, true);
$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = false;
// 设置参数(注意:PHP只能以'数组集'方式传递参数,如果服务端是java,用Map接收)
$param = array( 'username' => 'E090500001',
'password' => '张三',
'securityCode' => '2009-05-19');
// 调用远程方法
$result = $client->call('checkLogin', array($param));
// 显示执行结果
if (!$err=$client->getError()){
foreach ($result as $row){
echo $row;
}
}else{
echo '错误 : '.$err;
}
- nusoap.rar (156.3 KB)
- 下载次数: 0