Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8557229
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:31:44+00:00 2026-06-11T15:31:44+00:00

I am trying to call a web service from Android client on the Magento

  • 0

I am trying to call a web service from Android client on the Magento Store.
I have good success till now but have little problem.

I want this array to be converted in to appropriate java Object.

$arrProducts = array(
array(
    "product_id" => "1",
    "qty" => 2
),
array(
    "sku" => "testSKU",
    "quantity" => 4
)
);
$resultCartProductAdd = $proxy->call($sessionId, "cart_product.add", 
                                        array($shoppingCartId, $arrProducts));  

The Above php code has been taken from here

What I have tried.

Object []addtocart=null;
Log.i("Product Id ", Utils.product_list.get(rowid).getp_Id());
Object[] productdetails1=new Object[]{Utils.product_list.get(rowid).getp_Id(),2};
//Object[] productdetails2=new Object[]{productdetails1};
Object param1[]=new Object[]{Utils.shoppingCartId,productdetails1};
Object param[]=new Object[]{Utils.sessionId,"cart_product.add",param1};
try {
    addtocart=(Object[])client.callEx("call", param);
} catch (XMLRPCException e) {
    e.printStackTrace();
}

But it results into error like the :

org.cws.magentoAnd.xmlrpc.XMLRPCFault: XMLRPC Fault: One item of products do not have identifier or sku [code 1022]
at org.cws.magentoAnd.xmlrpc.XMLRPCClient.callEx(XMLRPCClient.java:228)
at org.cws.magentoAnd.ProductModule.productdetails$CartFunctions.doInBackground(productdetails.java:245)
at org.cws.magentoAnd.ProductModule.productdetails$CartFunctions.doInBackground(productdetails.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:185)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
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)

I would be happy if someone having dual knowledge of php and Java would help me to solve this Issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T15:31:45+00:00Added an answer on June 11, 2026 at 3:31 pm

    Ok,getting some Ideas from @ sharadendu sinha's Answer, I have made a Associative Array like thing in Java that would get the required result.

    The code is as below.

    Map map = new HashMap();
    map.put("product_id", 1);
    map.put("quantity", 1);
    Object[] productdetails1=new Object [] {map};
    Object param1[]=new Object[]{Utils.shoppingCartId,productdetails1};
    Object param[]=new Object[]{Utils.sessionId,"cart_product.add",param1};
    try {
        Object addtocart=client.callEx("call", param);
        Log.i("Out Put of Adding", addtocart.toString());
    } catch (XMLRPCException e) {
        e.printStackTrace();
    }  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to call a web service from asp.net 3.5 application. I have
I'm trying to call a RESTful web service from an Android application using the
I'm trying to contact a RESTful WCF POST web service from an android client
I am trying to call a web service from an iOS app. I have
I'm running into this problem when trying to call a SOAP Web Service from
Trying to call a SAP SOAP Web Service from a generated sudzc app shows
I am trying to make a web service call from PHP to a SOAP
I am trying to retrieve information from a web service call. The following is
I am trying to call a web service from an ajax jquery. It is
I'm trying to call web service for few hours. I have added clientaccesspolicy.xml: <?xml

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.