Actually, the problem is NOT how to do it, but if it is a design error. I am worried because I read a lot about using only standard data types in WS. However, I had no problem implementing a package that receives a HashMap and populates this parameter with PHP using nuSoap.
I have a ParameterBean class with these members (e.g. getters and seters) that includes a HashMap.
private int ID; private String value; private String name; private HashMap<Integer, String> map = new HashMap<Integer, String>();
And a service that gets an instance from this class. Then from the PHP client, I call:
$map = array(1 => 'Foo', 2 => 'Bar'); $paramsp = array( 'ID' => '1', 'value' => 'Some Value', 'name' => 'A Name', 'map' => $map ); $params = array($paramsp); $resp = $client->call('test',$params); print_r($client->response);
It works like a charm! Question: Is it frowning? Will this lead to a headache in the future in some way?
source share