I’m trying to get data from a java webservice and display the information on the dhtmlx grid.
Here is my configuration :
- php client using nusoap
- java web service using xfire
- dhtmlx datagrid parse using json (json_encode() is used to transform the xml to json format)
client.php…
<?php
require_once(’…/lib/nusoap.php’);
$client = new SoapClient(‘http://localhost:7272/services/UserService?wsdl’, array(‘encoding’=>‘UTF-8’));
$param = array(‘in0’ => ‘JJ’);
$result = $client->call(‘findLikeInitials’, $param);
echo ‘
’ .json_encode($result[“out”]);
?>
The output is the following…
{“User”:[{“firstName”:“David”,“id”:“555”,“initials”:“JJ1”,“lastName”:“Jones”},{“firstName”:“Mark”,“id”:“654”,“initials”:“JJ2”,“lastName”:“McGwire”},{“firstName”:“Greg”,“id”:“8741”,“initials”:“JJ3”,“lastName”:“Maddux”},{“firstName”:“Don”,“id”:“1112”,“initials”:“JJ4”,“lastName”:“Mattingly”},{“firstName”:“David”,“id”:“4444”,“initials”:“JJ5”,“lastName”:“Ortiz”}]}
Is dhtmlx grid flexible to use the above format w/ configuration parameters ? (similiar to the xmlB option that allows you to specify the xml tag name). note: i would like to avoid writing php code to transform the ws result to a json format that dhtmlx understands.
Also, I’m open to alternative approaches… but I must call a java web service written w/ xfire directly from the client (i.e. using javascript, php, etc).
Thx in advance.