Hi All,
I am writing an application where i have to interact with MS SQL database. In my application i am creating web services (using javax.jws) for accessing database tables. i am creating one operation(method) in web service with return type java.lang.Object[][] as follows :
@WebMethod(operationName = "get_HistoryInfoByUser")
public java.lang.Object[][] get_HistoryInfoByUser(@WebParam(name = "email_Id")
String email_Id) throws Exception{
java.lang.Object[][] historyInfo = null;
// some code here
return historyInfo;
}
and for calling web service operation(method) in my application, i am writing following code:
public Object[][] get_HistoryInfoByUser(String email_Id) {
java.util.List<net.java.dev.jaxb.array.AnyTypeArray> historyInfo = null;
try {
historyInfo = port.getHistoryInfoByUser(email_Id);
} catch (Exception_Exception ex) {
ex.printStackTrace();
}
return (Object[][]) historyInfo.toArray();
}
but i am getting an Exception
Exception in thread "Thread-8" java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [[Ljava.lang.Object;
Web service operation return type is java.util.List(net.java.dev.jaxb.array.AnyTypeArray) and i need return type java.lang.Object[][].
Please can you give me any suggestion, which will help me to overcome with this problem.