开发者

Vector of Vector in a Java webservice

开发者 https://www.devze.com 2023-01-19 20:11 出处:网络
I am writing a webservice method to return the values of a table.I am using two Vectors one for the column and another for the values of the table.The Vector used for Values of the table contain each

I am writing a webservice method to return the values of a table.I am using two Vectors one for the column and another for the values of the table.The Vector used for Values of the table contain each row as a Vector.These methods are written inside an EJB and the webservice is deployed in Weblogic 10.3. I am able to hit the webservice and call the methods a开发者_如何学运维nd able to fetch the columnnames Vector.However when I fetch the values Vector I am just getting the Object class reference(address).I think I have to add something in xmltype-mapping.xml and I have never worked on it.Can anyone suggest what should be done so that I can retrieve the values of the table too.


I am using Vector only and the values are stored perfectly in the server side but when I retrieve in the client side I am getting the address of the Object in place of the individual Vectors.

That's probably because you are trying to convert the Vector<Vector> to a String and passing the String. You might be doing it explicitly by calling vec.toString(), or you might be doing something like this:

String element = "<something>" + vec + "</something>";

The problem is that the Vector class does not override the toString() method, and your code ends up calling Object.toString() ... which gives you the array's internal class name concatenated with the array's identity hashcode value.

That's what is happening, but I don't know what you need to do to fix it, given the technologies you are using.

0

精彩评论

暂无评论...
验证码 换一张
取 消