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 6600415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:37:09+00:00 2026-05-25T18:37:09+00:00

Im trying to use ksoap2 with a webservice in android but I think i

  • 0

Im trying to use ksoap2 with a webservice in android but I think i cannot get a respond from the webservice. Anyone knows why i get this error?
“org.xmlpull.v1.XmlPullParserException: expected: START_TAG”

my code is:

public class ANDROIDsapActivity extends Activity {
    /** Called when the activity is first created. */
    private static final String NAMESPACE = "urn:sap-com:document:sap:soap:functions:mc-style";
    private static final String URL = "http://192.168.2.5:8000/sap/bc/srt/wsdl/bndg_E0DFBFD4F407C3F1A6A000155D02060A/wsdl11/allinone/ws_policy/document?sap-client=500";    
    private static final String SOAP_ACTION = "zws_get_customer";
    private static final String METHOD_NAME = "ZfGetCustomers";
        TextView tv;
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        tv = (TextView) findViewById(R.id.textView1);

        SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);
        Request.addProperty("IM_NAME","M");

        SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        soapEnvelope.setOutputSoapObject(Request);

        soapEnvelope.encodingStyle = SoapSerializationEnvelope.ENC2003;
        soapEnvelope.bodyOut = Request;
        soapEnvelope.dotNet = true;
        soapEnvelope.encodingStyle = SoapSerializationEnvelope.XSD;

       // AndroidHttpTransport aht = new AndroidHttpTransport(URL);
        HttpTransportSE aht = new HttpTransportSE(URL);
        aht.setXmlVersionTag("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        List<HeaderProperty> headers = new ArrayList<HeaderProperty>();
        headers.add(new HeaderProperty("Authorization",  "basic " +
                Base64.encode("username:password".getBytes())));

        try {
            aht.call(SOAP_ACTION, soapEnvelope,headers);
            SoapPrimitive resultString = (SoapPrimitive) soapEnvelope.getResponse();
            tv.setText("Status: " + resultString);
        } catch (Exception e) {
            // TODO: handle exception
            tv.setText(e.toString());
        }
    }
}

my complete error is :

org.xmlpull.v1.XmlPullParserException: expected: START_TAG  
{http://schemas.xmlsoap.org/soap/envelope/} Envelope  
(position:START_TAG <{http://schemas.xmlsoap.org/wsdl/}wsdl:definitions  
targetNamespace='urn:sap-com:document:sapsoap:functions:mc-style'>  
@1:630 in java.io.InputStreamReader@43e50a10

I’m stuck in this error and I cant go any further.
Please help!

EDIT: I HAVE SOLVED THIS. PLEASE READ MY ANSWER BELOW ON COMMENTS AND ANSWERS.
I HOPE I’LL BE HELPFUL FOR SOMEONE IN SOMEWAY.

  • 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-05-25T18:37:10+00:00Added an answer on May 25, 2026 at 6:37 pm

    I have solved my problem by just changing the web service style. Use Restful webservice system instead of SOAP if you want to integrate SAP and android.

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

Sidebar

Related Questions

I am new to android programming and trying to use webservice in this sample
I'm trying use this code to get image resolution from file bool GetImageSizeEx(const char
I am trying to use a .NET service in Android Application using the ksoap2
I'm trying to use webservicex.net in android for currency conversion using ksoap2. However, it
I'm trying to use ksoap to call a simple webservice. I followed this video
I'm trying to upload a complex object to a WCF webservice using KSoap2 Android
I am trying use std::copy to copy from two different iterator. But during course
I'm trying use to selenium with firefox on CentOS from command line like this:
i'm trying use webview to load a image from sdcard i use this path
I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The

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.