この例外があります。スレッドの概念を使用してこれを行うにはどうすればよいですか?
public class WebService extends AsyncTask<String, String, String>{
private final String NAMESPACE ="http://tempuri.org/";//"http://localhost:9583/YP_Android_WebService/YP_Android_WebService.asmx";//
private final String URL ="http://10.0.2.2:1243/YP_Android_WebService/YP_Android_WebService.asmx?WSDL";
public boolean checkUser(String _EmailID, String _Password) {
boolean result = false;
final String SOAP_ACTION ="http://tempuri.org/checkUser";//"http://localhost:9583/YP_Android_WebService/YP_Android_WebService.asmx/checkUserLogin";//
final String METHOD_NAME = "checkUser";
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
PropertyInfo propertyInfoEmail = new PropertyInfo();
propertyInfoEmail.setName("_EmailID");
propertyInfoEmail.setValue(_EmailID);
propertyInfoEmail.setType(String.class);
request.addProperty(propertyInfoEmail);
PropertyInfo propertyInfoPassword = new PropertyInfo();
propertyInfoPassword.setName("_Password");
propertyInfoPassword.setValue(_Password);
propertyInfoPassword.setType(String.class);
request.addProperty(propertyInfoPassword);
final SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true; // put this only if the web service is .NET one
envelope.setOutputSoapObject(request);
final HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapPrimitive response = (SoapPrimitive)envelope.getResponse();
Log.i("myApp", response.toString());
if(response.toString().equalsIgnoreCase("true")){
result = true;
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
}
例外はこの時点です。
androidHttpTransport.call(SOAP_ACTION、エンベロープ); tiはNetworkonMainThread例外をスローします。
スレッドの概念を使用してこれを行うのを誰かが助けてくれますか