[Java for Android App Development] Magesh.K:
THIS IS MY CLIENT SIDE ANDROID APP

package com.example.project10;

import java.io.BufferedReader;

import java.io.IOException;

import java.io.InputStreamReader;

import android.annotation.SuppressLint;

import android.annotation.TargetApi;

import android.app.Activity;

import android.os.AsyncTask;

import android.os.Build;

import android.os.Bundle;

import android.os.Handler;

import android.os.StrictMode;

import org.ksoap2.SoapEnvelope;

import org.ksoap2.SoapFault;

import org.ksoap2.serialization.SoapObject;

import org.ksoap2.serialization.SoapPrimitive;

import org.ksoap2.serialization.SoapSerializationEnvelope;

import org.ksoap2.transport.AndroidHttpTransport;

import org.ksoap2.transport.HttpTransportSE;

import org.xmlpull.v1.XmlPullParserException;

import android.view.Menu;

import android.widget.TextView;

public class MainActivity extends Activity {

private static final String SOAP_ACTION = "http://Sample/customerData";

private static final String METHOD_NAME = "customerData";

private static final String NAMESPACE = "http://Sample";

private static final String URL = "http://192.168.1.16:8080/Project10/services/Main?wsdl";

private Thread thread;

public TextView tv;

String resultArr;

public String str;

private Handler handler = new Handler();

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

setContentView(R.layout.activity_main);

tv =(TextView)findViewById(R.id.textView1);

Thread networkThread = new Thread() {

[MENTION=439709]override[/MENTION]

public void run() {

try {

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);

envelope.setOutputSoapObject(request);

HttpTransportSE ht = new HttpTransportSE(URL);

ht.call(SOAP_ACTION, envelope);

final SoapObject result=(SoapObject) envelope.bodyIn;

if(result!= null){

System.out.println("Response");

System.out.println("..."+result.toString());

}

str = result.toString();

System.out.println(str);

runOnUiThread (new Runnable(){

public void run() {

TextView tv;

tv = (TextView)findViewById(R.id.textView1);//Text view id is textView1

tv.setText(str);

}

});

}

catch (Exception e) {

e.printStackTrace();

}

}

};

networkThread.start();

}

WEB SERVICE code:

import java.sql.Connection;

import java.sql.DriverManager;

import java.sql.ResultSet;

import java.sql.SQLException;

import java.sql.Statement;

import org.apache.http.HttpEntity;

import org.apache.http.util.EntityUtils;

import com.sun.xml.internal.bind.v2.runtime.unmarshaller.XsiNilLoader.Array;

public class SampleMain {

public String customerData(){

String customerInfo = "";

String first="";

int a=12;

StringBuffer sb = new StringBuffer();

try{

Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");

Connection con = DriverManager.getConnection("jdbc:sqlserver://D9-2-PC:1433;user=sa;password=123;database=ADB");

Statement sta = con.createStatement();

String Sql = "select * from [app] where postname='name'";

ResultSet result = sta.executeQuery(Sql);

System.out.println(result);

while(result.next()){

String id = result.getString("post_id");

String firstName = result.getString("postname");

String lastName = result.getString("comments");

sb.append("ID: " + id + ", First Name: " + firstName

customerInfo = customerInfo + result.getString("appname");

System.out.println("First: " + customerInfo);

}

}

catch(Exception exc){

System.out.println(exc.getMessage());

}

first=customerInfo;

System.out.println(customerInfo);

System.out.println(sb.toString());

return sb.toString();

}

I AM GETTING THIS "anytype{}" in emulator

help me