How to pass response from ksoap to another activity

Problems with WiFi, SQLite ,Bluetooth, WiMax, Proxies, etc...

How to pass response from ksoap to another activity

Postby sooraj.rit » Mon Jan 19, 2009 9:13 am

Hi,

Can anybody please tell how to pass response from ksoap to another activity. I have attached the code. Please suggest the required modifications.Thanks for your help in advance....



package med.help;

import java.io.IOException;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.SoapFault;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class medbase extends Activity {
/** Called when the activity is first created. */

protected static final int SEARCH_REQUEST_CODE = 1337;
private static final String SOAP_ACTION = "http://webservice.org/GetAllIDs";
private static final String METHOD_NAME = "GetAllIDs";
private static final String NAMESPACE = "http://webservice.org/";
private static final String URL = "http://10.1.26.21/Webservice/Service1.asmx";
private Object resultRequestSOAP = null;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

Button bcmd_opensub = (Button)findViewById(R.id.Search);
bcmd_opensub.setOnClickListener(new OnClickListener()
{
// @Override
public void onClick(View arg0)
{

SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
//request.addProperty(PropertyInfo(name, java.lang.String), "arg1");
envelope.setOutputSoapObject( request );
HttpTransportSE transport = new HttpTransportSE(URL);
try
{
try
{
transport.call(SOAP_ACTION, envelope);
}
catch( IOException exp )
{
exp.printStackTrace();
}
try
{
resultRequestSOAP = envelope.getResponse();
}
catch( SoapFault exp )
{
exp.printStackTrace();
}

String results = resultRequestSOAP.toString();

}
catch (Exception aE)
{
aE.printStackTrace ();
}

Intent iSearchObj = new Intent(medbase.this,
PatientSearch.class); // PatientSearch is the child activity
iSearchObj.setAction(SOAP_ACTION);

// We use SUB_ACTIVITY_REQUEST_CODE as an 'identifier'
medbase.this.startActivity(iSearchObj );
}
}
);
}
}
sooraj.rit
Freshman
Freshman
 
Posts: 5
Joined: Tue Jan 13, 2009 12:29 pm
Location: Trivandrum,India

Top

Return to Networking & Database Problems

Who is online

Users browsing this forum: Yahoo [Bot] and 3 guests