Php transmits an array to java. the length of the array received by java is 0 $ NusoapWSDL = "http: // 192.168.1.111: 9080/leanprocess/ws/bbsdatatb? Wsdl ";
// Generate client object
$ Client = new soapclient ($ NusoapWSDL, true );
// Set parameters (note: PHP can only pass parameters in the 'Array set' mode. if the server side is java, Map is used to receive parameters)
$ Param = array ('dept' => '000000', 'reply' => '000000', 'Commentary '=> '46 ', 'date' => '2017-8 ');
Echo "begin remote...
";
// Call the remote method
$ Result = $ client-> call ('tbbbsdata', array ($ param ));
Echo "debug:". array ($ param )."
";
Echo "end remote...
";
// Display the execution result
If (! $ Err = $ client-> getError ()){
Echo 'result: '. $ result;
} Else {
Echo 'Error: '. $ err;
}
This is an array passed to java. java uses cxf, but the length of the received array is 0. what is the problem.
Reply to discussion (solution)
It depends on how the WSDL is defined.
-
-
-
-
-
-
-
-
-
-
-
This is the wsdl
The definition in your WSDL
Boolean TbBbsData (string $ arg0)
The parameter is a string and will not be interpreted as an array.
Then how can we change this boolean TbBbsData (string $ arg0) to an array!
The service is provided by the other party and must be modified by the other party.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Now the wsdl is changed to this type, but the array received by the other party is still 0.
No answer? In a hurry!
Solve the problem by using SoapClient to spell strings