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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:06:41+00:00 2026-06-13T19:06:41+00:00

Hello I am trying to solve this problem for past 5 hours now my

  • 0

Hello I am trying to solve this problem for past 5 hours now my web service use to work fine until I recently installed windows 8 and setup eclipse and android SDK.

My problem is that I added external jar ksoap and created a sample web service for the test.

When calling for the Soap response exception is created
“11-01 11:10:00.161: E/dalvikvm(304): Could not find class ‘org.ksoap2.serialization.SoapObject’, referenced from method com.example.testweb.MainActivity.Send”

Below is my xml code for the mainActvity.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >

   <TextView
    android:id="@+id/textView1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="194dp"
    android:text="TextView" />

  </RelativeLayout>

MainActivity.class

package com.example.testweb;


import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;


import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.widget.Toast;


public class MainActivity extends Activity {


 private static final String NAMESPACE = "http://tempuri.org/";
 private static final String URL = "http://10.0.2.2:34253/Service1.asmx"; 
 private static final String SOAP_ACTION = "http://tempuri.org/HelloWorld";
 private static final String METHOD_NAME = "HelloWorld";




   @Override
   public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Send();
   }

   @Override
   public boolean onCreateOptionsMenu(Menu menu) {
    getMenuInflater().inflate(R.menu.activity_main, menu);
    return true;
  }




   public void Send()
   {
     SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);

         SoapSerializationEnvelope envelope = new   SoapSerializationEnvelope(SoapEnvelope.VER11);
       envelope.dotNet=true;
       envelope.setOutputSoapObject(request);

       HttpTransportSE androidHttpTransport = new HttpTransportSE(URL, 5000);

       try
       {
            androidHttpTransport.call(SOAP_ACTION, envelope);
           // SoapPrimitive response = (SoapPrimitive) envelope.getResponse();

            SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
            //Hello World; }
            String result = resultsRequestSOAP.toString();
            Toast.makeText(this, result, Toast.LENGTH_LONG).show();

       }
       catch (Exception e) {
        // TODO: handle exception
           Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
    }

}

}

AndroidMenifest.XML

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.example.testweb"
  android:versionCode="1"
  android:versionName="1.0" >

  <uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="15" />

<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/title_activity_main" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

ScreenShot of the Ksoap.jar
Ksoap Reference
enter image description here

My ASP.NET 3.5 Webservice code which i am running on localhost

/// <summary>
/// Summary description for Service1
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment    the following line. 
// [System.Web.Script.Services.ScriptService]
public class Service1 : System.Web.Services.WebService
{

    [WebMethod]
    public string HelloWorld()
    {
        return "Hello World";
    }
 }

I am using google api 8 and my ADT is 20.0.3 and my ksoap.jar is 2.6.5

Edit
Guys my Jar problem is solved now a new error i am receiving which occurs on this link

    androidHttpTransport.call(SOAP_ACTION, envelope);

And the exception in the try catch gives me this error

     org.xmlpull.v1.XmlPullParserException: expected: START_TAG {schemas.xmlsoap.org/soap/envelope}Envelope (position:START_TAG <HTML>@2:7 in     java.io.InputStreamReader@44ef85f0)

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-13T19:06:43+00:00Added an answer on June 13, 2026 at 7:06 pm

    In the order and export setting try moving KSOP lib to top of the list.

    EDIT 1: It looks like for some reason android not been able to connect to your sever and ksoap2 is not able to handle http response codes properly by default. it tries to parse a http error message like “file not found” and throws an exception as it is not valid SOAP. Try to use the ksoap2 source code in place of lib and check the http response code. source code is available at the this link..

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

Sidebar

Related Questions

hello i am a noob and i am trying to solve this for hours.I
(Problem solved now, see answers below) Hello, in my app I am trying to
THIS PROBLEM IS NOW SOLVED. THANK YOU TO EVERYONE WHO REPLIED. Hello, I am
Hello everyone, I have been banging my head really hard trying to solve this
Hello I'm trying something .. I was reading Jquery traversing documentations some forums, this
I'm trying to use inheritance in JavaScript here, and I found problem having array
I am developing for Honeycomb and for days i am trying to solve this
So I have been tearing my hair out trying to make this work. I
I spent about 4 hours yesterday trying to fix this issue in my code.
Hello can anybody solve this please I'm creating the object in the action class

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.