Boa tarde, forum!
Tenho um WebMethod que retorna valores provenientes de uma query sql em um List<String[]>. Quero fazer a chamada desse WMethod em uma jsp para visualizar o conteudo retornado. Estou fazendo da seguinte maneira, mas o retorno vem apenas com inumeros net.java.dev.jaxb.array.StringArray@77b826e2 referente a cada tupla armazenada na variavel.
Esse eh meu WMethod:
/**
* Web Method description:
* Return all ID recorded in PCD's dataset
*
* @return a list with the records returned by the query
*
*/
@WebMethod(operationName = "listIdAll")
public List<String[]> listIdAll() {
EDAAccess db = new EDAAccess();
List<String[]> result = new ArrayList<String[]>();
String sql = "select id_estacao_cli as ID from estacoes_cli";
try {
if (!db.connection()) {
result.add(new String[]{"Error", "It was not possible to establish connection with database.There is some issue in EDAAccess class."});
} else {
//Retorna via wsdl os resultados retornados pela query
result = db.queryBySql(sql);
if (result.isEmpty()) {
result = null;
}
System.out.println(result);
}
} catch (SQLException ex) {
result.add(new String[]{"Exception", ex.toString()});
}
return result;
}
E essa eh a chamada na minha JSP:
eda.services.EDAServicesPCDService service = new eda.services.EDAServicesPCDService();
eda.services.EDAServicesPCD port = service.getEDAServicesPCDPort();
// TODO process result here
java.util.List<net.java.dev.jaxb.array.StringArray> result = port.listIdAll();
for(StringArray news : result)
for (StringArray it:result){
for (int i = 0 ; i < result.size(); i++){
out.println(result.get(i));
}
}
Alguem pode me ajudar ???
Obrigada!