Php transmits an array to java. the length of the array received by java is 0.

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.