Hi i want to implement a webmethod to search some data and I have done it well in C#.net . Now i want to access that method from android . The real problem I am facing is that, I have to use a complex data type. ( a class containing two strings ). when I call the webmethod, an exception is thrown (Runtime exception saying -" cannot serialize my class "). I have attached my code.pls help me.
I am using a class to hold my data as
class PAT_DETAILS
{
String PatName;
String PatID;
}
and in my java code
public class SearchData extends Activity
{
private static final String SOAP_ACTION = "http://MobWebService.org/GetPatDetails";
private static final String METHOD_NAME = "GetPatDetails";
private static final String NAMESPACE = "http://MobWebService.org/";
private static final String URL = "http://10.1.26.21/Webservice/SearchService.asmx";
PAT_DETAILS m_PatDetails;
@Override
public void onCreate( Bundle savedInstanceState )
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
m_PatDetails.PatName = "John";
m_PatDetails.PatID ="123";
SoapObject request = new SoapObject( NAMESPACE, METHOD_NAME );
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope( SoapEnvelope.VER11 );
envelope.dotNet = true;
request.addProperty( "patDetails", m_PatDetails );
envelope.setOutputSoapObject( request );
HttpTransportSE htransport = new HttpTransportSE( URL );
try
{
try
{
htransport.call( SOAP_ACTION, envelope ); // throws exception
}
catch( IOException exp )
{
exp.printStackTrace();
}
SoapObject ResultRequestSOAP = (SoapObject)envelope.bodyIn;
// Remaining codesnippet here......
}
catch ( Exception aE )
{
aE.printStackTrace (); //Runtime exception here - "cannot serialize my class "
}
}
Pls help


