php向java傳數組,java接收到的數組長度為0

來源:互聯網
上載者:User
$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 中是如何定義的


-
-


-


-
-




-

-

-


-




-
-




這個是wsdl

你的 WSDL 中之定義了
boolean TbBbsData(string $arg0)
參數是一個字串,當然不會解釋成數組啦

那怎麼才能將這個boolean TbBbsData(string $arg0)改為數組啊!

服務是對方提供的,當然要由對方修改


-
-
-
-
-





-


-


-
-




-

-

-


-




-
-




現在wsdl改成這種了,可是對方接到的數組還是為0

沒有人解答嗎?急急急啊!

用SoapClient拼字串解決了

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.