Home > Backend Development > PHP Tutorial > php向java传数组,java接收到的数组长度为0,该怎么处理

php向java传数组,java接收到的数组长度为0,该怎么处理

WBOY
Release: 2016-06-13 12:07:40
Original
1100 people have browsed it

php向java传数组,java接收到的数组长度为0
$NusoapWSDL="http://192.168.1.111:9080/leanprocess/ws/bbsdatatb?wsdl";
// 生成客户端对象
$client = new soapclient($NusoapWSDL, true);
// 设置参数(注意:PHP只能以'数组集'方式传递参数,如果服务端是java,用Map接收)
$param = array( 'dept' => '165','reply'=>'330','commentary'=> '46','date'=> '2014-8');
echo "begin remote 。。。
";
// 调用远程方法
$result = $client->call('TbBbsData', array($param));
echo "debug:  ".array($param)."
";
echo "end remote 。。。
";
// 显示执行结果
if (!$err=$client->getError()){   
 echo '结果 : '.$result;     
}else{   
 echo '错误 : '.$err;   

这个是向java传的数组,传过去了,java用的是cxf,但是接收到的数组长度是0.这是怎么回事。
------解决思路----------------------
你的 WSDL 中之定义了
boolean TbBbsData(string $arg0)
参数是一个字符串,当然不会解释成数组啦

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template