Home >php教程 >php手册 >java调用webservice:php调用java webservice

java调用webservice:php调用java webservice

WBOY
WBOYOriginal
2016-06-21 08:51:372080browse

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



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn