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 );
}
}
);
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---