retrieve data from mysql db via ksoap2

Put problems with the Android NDK in this forum.

retrieve data from mysql db via ksoap2

Postby krishnaveni » Sat Mar 03, 2012 11:06 am

am trying to retrieve data from MySQL database via ksoap2 webservices in android.am getting following error in my emulator.the error is ReturnCode-->0 nIP-->null nReturnCodeDetails-->null nCountryCode-->null nCountryName-->null...Why dis error is came and how it is cleared..plz help me.


Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. package com.retrieve;
  2. import org.ksoap2.SoapEnvelope;
  3. import org.ksoap2.serialization.SoapObject;
  4. import org.ksoap2.serialization.SoapSerializationEnvelope;
  5. import org.ksoap2.transport.HttpTransportSE;
  6. import android.app.Activity;
  7. import android.os.Bundle;
  8. import android.widget.TextView;
  9. public class RetrieveAndroidActivity extends Activity {
  10.  
  11.         private String METHOD_NAME = "getLoginDetails"; // our webservice method name
  12.         private String NAMESPACE = "http://retri.com"; // Here package name in webservice with reverse order.
  13.         private String SOAP_ACTION = NAMESPACE + METHOD_NAME; // NAMESPACE + method name
  14.        
  15.         private static final String URL = "http://192.168.1.249:8080/Retrievedata/services/retr?wsdl"; // you must use ipaddress here, don't use Hostname or localhost
  16.  
  17.         public void onCreate(Bundle icicle)
  18.         {
  19.         super.onCreate(icicle);
  20.         setContentView(R.layout.main);
  21.         TextView tv = (TextView) findViewById(R.id.txtsearch);
  22.         try
  23.         {
  24.         SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
  25.         SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
  26.         envelope.setOutputSoapObject(request);
  27.         HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
  28.         androidHttpTransport.call(SOAP_ACTION,envelope);
  29.         SoapObject so = (SoapObject)envelope.bodyIn;
  30.  
  31.         System.out.println("Counter: "+so.getPropertyCount());
  32.  
  33.         for(int i =0; i < so.getPropertyCount(); i++){
  34.         SoapObject soap = (SoapObject) so.getProperty(i);
  35.         System.out.println("login :: "+ soap.getProperty("login"));
  36.         System.out.println("password :: "+ soap.getProperty("password"));
  37.        
  38.         }
  39.  
  40.         tv.setText(so.toString());
  41.         } catch (Exception E) {
  42.         E.printStackTrace();
  43.         tv.setText("ERROR:" + E.getClass().getName() + ": " + E.getMessage());
  44.         }
  45.         }
  46.         }
Parsed in 0.040 seconds, using GeSHi 1.0.8.4

Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3.      package="com.retrieve"
  4.      android:versionCode="1"
  5.      android:versionName="1.0">
  6.     <uses-sdk android:minSdkVersion="7" />
  7.   <uses-permission android:name="android.permission.INTERNET" />
  8.     <application android:icon="@drawable/icon" android:label="@string/app_name">
  9.         <activity android:name=".RetrieveAndroidActivity"
  10.                  android:label="@string/app_name">
  11.             <intent-filter>
  12.                 <action android:name="android.intent.action.MAIN" />
  13.                 <category android:name="android.intent.category.LAUNCHER" />
  14.             </intent-filter>
  15.         </activity>
  16.  
  17.     </application>
  18. </manifest>
Parsed in 0.003 seconds, using GeSHi 1.0.8.4

then y dis error is came...plz help me friends.
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 1 guest