Return 2D array from web service
Hi All,
I am new to web services development and start developing web service using net bean 6.9. I want to create the web service which needs to return the 2-d array. So i created it like this
public Object[][] getData(@WebParam(name = "startDate")
String startDate, @WebParam(name = "endDate")
String endDate) {
HashMap hm= new HashMap();
hm.put("key1", "val1");
hm.put("key2", "val2");
Object[][] twoDarray = new String[hm.size()][2];
Object[] keys = hm.keySet().toArray();
Object[] values = hm.values().toArray();
for (int row = 0; row < twoDarray.length; row++) {
twoDarray[row][0] = keys[row];
twoDarray[row][1] = values[row];
}
return twoDarray;
}
But when i test the web service using SOAPui then it did not returning anything. Can anyone guide me where is the problem??
Thanks
Shuja