My code:
Object res = stub.call(sessionId, "sale.list", "11111");
HashMap<String, String> map = (HashMap<String, String>) res;
Converting object into HashMap i got following exception,
Exception in thread "main" java.lang.ClassCastException: [Ljava.util.HashMap;
cannot be cast to java.util.HashMap
Can anyone help me how to retrieve object data?
You can cast res to HashMap only if stub.call(sessionId, "sale.list", "11111") returns a HashMap object.
[Ljava.lang.HashMap; indicates that what you are getting is an array of hashMap and not a single HashMap.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With