日期:2011-10-16  浏览次数:20609 次


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( 'in0' => 'e090500001',
'in1' => '张三',
'in2' => '2009-05-19');
// 调用远程方法
$result = $client->call('checklogin', array($param));
// 显示执行结果
if (!$err=$client->geterror()){
foreach ($result as $row){
echo $row;
}
}else{
echo '错误 : '.$err;
} 本文链接http://www.cxybl.com/html/wlbc/Php/20120607/28512.html