I had written a class in android which will consume a webservice to read some data from the webservice.
When am accessing that webservice through the URL call am getting that response xml properly. I had deployed the webservice in my local server and my url something like http://localhost:8083/TestWebService/services/GetDatabaseRecords?wsdl.
Following is the code portion am using to consume webservice in my app.
private String METHOD_NAME = "getSupplierDetails"; // our webservice method name
private String NAMESPACE = "http://test.webservice.com/"; // Here package name in webservice with reverse order.
private String SOAP_ACTION = NAMESPACE + METHOD_NAME; // NAMESPACE + method name
private static final String URL = "http://my-machine-ip:8083/TestWebService/services/GetDatabaseRecords?wsdl";
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug = true;
androidHttpTransport.call(SOAP_ACTION,envelope);
SoapObject so = (SoapObject)envelope.bodyIn;
Following is the exception am getting when runnning the application.
android.os.NetworkOnMainThreadException:null
Is something wrong with my code? Experts please help.