Web service retourne "java.util.List : "[net.java.dev.jaxb.array.StringArray@d72f242]" au lieu d'un tableau
Bonsoir,
J'ai un petit souci avec le test d'un service web sur netbeans!
Je veux retourner un tableau de type String[][] et voilà mon code
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
@WebService(serviceName = "visualisationArticle")
@Stateless()
public class visualisationArticle {
Connection conn = null;
ResultSet rs = null;
PreparedStatement pst = null;
String[][] tableau;
public visualisationArticle(){
conn=javaConnect.connectDB();
}
/**
* Web service operation
*/
@WebMethod(operationName = "visualiserArticle")
public String[][] visualiserArticle(@WebParam(name = "NumBL") int NumBL) {
String sql = "SELECT a.numArticle, a.Libelle, a.prixUnit FROM article a, details d WHERE d.NumBL = ? and d.numArticle = a.numArticle";
try{
pst=conn.prepareStatement(sql);
pst.setInt(1, NumBL);
rs=pst.executeQuery();
//int nbrLigne = rs.getRow();
tableau = new String[1][3];
int i=0;
while(rs.next()){
tableau[i][0] = rs.getString("numArticle");
tableau[i][1] = rs.getString("Libelle");
tableau[i][2] = rs.getString("prixUnit");
i++;
}
}catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
return tableau;
}
} |
Le problème c'est que dans l'affichage je reçois un retour de type:
java.util.List : "[net.java.dev.jaxb.array.StringArray@d72f242]" (je crois que c'est l'adresse dans laquelle le tableau se pointe) au lieu d'afficher le tableau lui même
P.S: sur jDeveloper je n'ai pas rencontré le même problème, le tableau est bel et bien affiché !
Merci d'avance.