I am making a request to the Magento
Server using XMLRPC
to get the details using multiCall()
function.
I have achieved success in calling the multiCall()
function as it does not results to any Exception
.
I am using Objects
to send data and when I use Object
DataType
to get the response,It gives the Exception
like
java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:200)
at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
at java.lang.Thread.run(Thread.java:1019)
Caused by: java.lang.ClassCastException: [Ljava.lang.Object;
at org.xmlrpc.ProductService$doingBackTask.doInBackground(ProductService.java:94)
at org.xmlrpc.ProductService$doingBackTask.doInBackground(ProductService.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:185)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
The code that I use to call is as followed:
Object[] skuid=new Object[product_list.size()];
Object calling[]=new Object[product_list.size()];
for(int m=0;m<product_list.size();m++)
{
skuid[m]=new Object[]{product_list.get(m).getp_Sku()};
calling[m]=new Object[]{"catalog_product_attribute_media.list",skuid[m]};
}
Object b[][];
try
{
// The Upcoming line causes Exception : java.lang.ClassCastException
b=(Object[][])client.callEx("multiCall",new Object[]{sessionId,calling});
}
catch (XMLRPCException e)
{
e.printStackTrace();
}