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

  • Home
  • SEARCH
  • 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 8157395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:16:13+00:00 2026-06-06T17:16:13+00:00

I am trying to call magento api using Soap from android but I am

  • 0

I am trying to call magento api using Soap from android but I am getting XMLpullparser Exception.I am using ksoap library.I seached on google but i can’t find any solution.Below is my code..

1 import java.io.IOException;

2 import org.ksoap2.SoapEnvelope;
3 import org.ksoap2.serialization.SoapObject;
4 import org.ksoap2.serialization.SoapSerializationEnvelope;
5 import org.ksoap2.transport.AndroidHttpTransport;
6 import org.xmlpull.v1.XmlPullParserException;

7 import android.app.Activity;
8 import android.os.Bundle;
9 import android.util.Log;

10       public class MagentoSoapActivity extends Activity {
11         /** Called when the activity is first created. */

12      private static final String NAMESPACE = "urn:Magento";
13      private static final String Method_Name="login";
14      private static final String URL ="http://www,mymagento,com/api/soap/?wsdl=1";
15      private static final String SOAP_ACTION ="urn:Magento/login";

16 @Override
17 public void onCreate(Bundle savedInstanceState) {
18    super.onCreate(savedInstanceState);
19    setContentView(R.layout.main);
20    try {
21      SoapObject request = new SoapObject(NAMESPACE,Method_Name);

22        request.addProperty("username", "XXX");
23        request.addProperty("apiKey", "YYY");
24        SoapSerializationEnvelope envelopes = new SoapSerializationEnvelope(
25                SoapEnvelope.VER11);

26        envelopes.dotNet = false;
27        envelopes.xsd = SoapSerializationEnvelope.XSD;
28        envelopes.enc = SoapSerializationEnvelope.ENC;


29       envelopes.setOutputSoapObject(request);

30        AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(URL);
31        androidHttpTransport.debug =true;
32        androidHttpTransport.call(SOAP_ACTION, envelopes);//Getting the Exception here
33        Object result = envelopes.getResponse();

34        Log.d("sessionId", result.toString());

35        //making call to get list of customers

36        String sessionId = result.toString();

37        request = new SoapObject(NAMESPACE,"customerCustomerList");
38        request.addProperty("sessionId",sessionId );

39        envelopes.setOutputSoapObject(request);
40        androidHttpTransport.call(SOAP_ACTION, envelopes);

41        result = envelopes.getResponse();

42        Log.d("Customer List", result.toString());

43    } catch (Exception e) {
44        e.printStackTrace();
45    }
46 }
47 }

Below is stacktrace:

org.xmlpull.v1.XmlPullParserException: expected: START_TAG   
{http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG <definitions   
name='Magento' targetNamespace='urn:Magento'>@4:50 in   
java.io.InputStreamReader@44f13f40) 

Please help me I am really depressed by this error.
Thanks in advance

  • 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-06T17:16:14+00:00Added an answer on June 6, 2026 at 5:16 pm

    I solved my problem.I changed the complete code and instead of using SOAP now I am using XMLRPC.There is XmLRPC library at http://code.google.com/p/android-xmlrpc/ and also the example of how to use this library.

    This is the link for how to parse this response in android http://inchoo.net/mobile-development/android-development/parsing-the-xmlrpc-webservice-response-in-android/

    Hope this helps someone.

    Thanks everyone for your response.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to follow a tutorail on connecting to magento API with Soap, but
Trying to call from an android client, using the signpost oauth libs. I generated
I am trying to call the Magento SOAP API and get a list of
Trying to call a SAP SOAP Web Service from a generated sudzc app shows
I'm trying to call a WCF service using soap in IE8 and I can't
While trying to call an EJB made using NETbeans (using jdk1.7) from a client
I trying to call some ejb bean method from tread. and getting error :
I am trying to call a helper class in magento but stuck with an
Im trying to call image_tag image.jpg from devise Mailer template but since its an
Am trying to call a JS script from a function library in another script.

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.