Yesterday, soap was used to transfer data to WebService. The string type data has been successfully transmitted, but several parameters failed to be transmitted. The java server received a null value.
Because I am PHP, and then the receiver is made by Java, and several parameters are of the list array type. I just started to pass the PHP array, but the server received empty, and then use the JSON format is still not good. Later, I asked my java colleagues. They said that the list array type does not have key values and key names like PHP,
Java’s list array only has the corresponding relationship between name and value, as shown below
$array = array ('userid '= > 1,' name '= >'zhangsan', params = > array (array ('name '= >'array 1','value '= >'value1'),'name '= >'array 2','value '= >'value2');
After passing the array to Java through the corresponding relationship between name and value, Java can parse the list array for storage.
Wei Soapcall returns an array of object type. You can use JSON first_ Encode, then JSON_ Decode is converted to array format for analysis and judgment.
So far, the soap data transfer is finished. Then there are some details of docking. Because Web services have user verification, I need to log in using their login methods first, and then get the corresponding session value. To avoid unnecessary repeated login steps, I cache this session value,
Put it into the cash directory, and then fetch and transfer the data each time. If the session is expired or invalid, judge according to the returned code, and then log in again to update the session value.