php ws client-java web service-dhtmlx datagrid

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.

The structure of used JSON can’t be seriously changed, so there is no way to load the data in such format.
You have two possibilities
a) Create custom data parser ( which is not such complex task ), for your custom format
    dhtmlx.com/docs/products/dhtmlxG … oadingdata