SOAP fault error

Put problems with the Android NDK in this forum.

SOAP fault error

Postby krishnaveni » Mon Mar 05, 2012 12:52 pm

i tried retrieve data from mysql database via ksoap2.but am getting one error.the error is:

ERROR:java.lang.ClassCastException.org.ksoap2.soap fault.

How it is cleared..plz help me why dis error is occurred...how is cleared...
the coding part is:
Code: Select all
[code]
package com.retri.android;

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

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class RetrieveAndroidActivity extends Activity {
private String METHOD_NAME = "getLoginDetails"; // our webservice method name
private String NAMESPACE = "http://retri.com"; // Here package name in webservice with reverse order.
private String SOAP_ACTION = NAMESPACE + METHOD_NAME; // NAMESPACE + method name
private static final String URL = "http://192.168.1.142:8080/Retrievedata/services/Retrieve?wsdl"; // you must use ipaddress here, don't use Hostname or localhost

public void onCreate(Bundle icicle)
{
super.onCreate(icicle);
setContentView(R.layout.main);
TextView tv = (TextView) findViewById(R.id.txtsearch);
try
{
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION,envelope);

SoapObject so = (SoapObject)envelope.bodyIn;

System.out.println("Counter: "+so.getPropertyCount());

for(int i =0; i < so.getPropertyCount(); i++){
SoapObject soap = (SoapObject) so.getProperty(i);
System.out.println("username :: "+ soap.getProperty("username"));
System.out.println("password :: "+ soap.getProperty("password"));

}

tv.setText(so.toString());
} catch (Exception E) {
E.printStackTrace();
tv.setText("ERROR:" + E.getClass().getName() + ": " + E.getMessage());
}
}
}[/code]


AndroidManifest.xml file is

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.retri.android"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".RetrieveAndroidActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

</manifest>
plz tell me how is cleared...
krishnaveni
Junior Developer
Junior Developer
 
Posts: 10
Joined: Wed Dec 21, 2011 6:23 am

Top

Return to NDK Problems

Who is online

Users browsing this forum: No registered users and 5 guests