I am trying to get my app to access a .NET web service using ksoap2 and I can't get it to work. Here is my code.
Java:
private Object resultRequestSOAP = null;
private static final String SOAP_ACTION = "getBaseData";
private static final String METHOD_NAME = "getBaseData";
private static final String NAMESPACE = "http://tempuri.org/";
private static final String URL = "http://chadcarey.com/2142/ws2142.asmx";
TextView tV;
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
TextView tv = ((TextView)findViewById(R.id.Tv));
//SOAP STUFF
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
//SoapObject
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet=true;
HttpTransport androidHttpTransport = new HttpTransport(URL);
try
{
androidHttpTransport.call(SOAP_ACTION, envelope);
resultRequestSOAP = envelope.getResponse();
String results = (String) resultRequestSOAP;
tv.setText(results);
}
catch (Exception aE)
{
aE.printStackTrace ();;
}
//SOAP STUFF
}
having an issue at the line "HttpTransport androidHttpTransport = new HttpTransport(URL); "
I am not a java person so I am still learning but I have no idea what I've done wrong here. Webservice is dot.net 3.5 and I'm working with android 1.5
Has anyone done this?? I can find TONS of examples but NO ONE to help troubleshoot this stuff....I've tried multiple other android forums already
Java:
private Object resultRequestSOAP = null;
private static final String SOAP_ACTION = "getBaseData";
private static final String METHOD_NAME = "getBaseData";
private static final String NAMESPACE = "http://tempuri.org/";
private static final String URL = "http://chadcarey.com/2142/ws2142.asmx";
TextView tV;
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
setContentView(R.layout.main);
TextView tv = ((TextView)findViewById(R.id.Tv));
//SOAP STUFF
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
//SoapObject
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet=true;
HttpTransport androidHttpTransport = new HttpTransport(URL);
try
{
androidHttpTransport.call(SOAP_ACTION, envelope);
resultRequestSOAP = envelope.getResponse();
String results = (String) resultRequestSOAP;
tv.setText(results);
}
catch (Exception aE)
{
aE.printStackTrace ();;
}
//SOAP STUFF
}
having an issue at the line "HttpTransport androidHttpTransport = new HttpTransport(URL); "
I am not a java person so I am still learning but I have no idea what I've done wrong here. Webservice is dot.net 3.5 and I'm working with android 1.5
Has anyone done this?? I can find TONS of examples but NO ONE to help troubleshoot this stuff....I've tried multiple other android forums already