H Jones
Lurker
Hello,
I am making a login app that is connected to sql server 2014 via SOAP web service.
Now everything is working perfectly between the web service and the sql server.
But in my android app, when I click on the login button nothing happens even though I am sure I entered the username and password correctly. (The app should move to a new activity onclick)
I am getting this in the logcat when I click the login button:
com.example.user.loginapp I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
Any hints ?
Here is part of my code:
I am making a login app that is connected to sql server 2014 via SOAP web service.
Now everything is working perfectly between the web service and the sql server.
But in my android app, when I click on the login button nothing happens even though I am sure I entered the username and password correctly. (The app should move to a new activity onclick)
I am getting this in the logcat when I click the login button:
com.example.user.loginapp I/System.out: (HTTPLog)-Static: isSBSettingEnabled false
Any hints ?
Here is part of my code:
Java:
public static String URL = "http://192.168.1.68:80/WebService-Test.asmx";
public static String NAMESPACE = "http://192.168.1.68/:80";
public static String SOAP_ACTION_LOGIN = "http://192.168.1.68:80/WebService-Test.asmx?op=Login";
public static String METHOD_NAME_LOGIN = "Login";
private class MyAsyncTask extends AsyncTask<String,Void,String>
{
@Override
protected String doInBackground(String... strings) {
SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME_LOGIN);
PropertyInfo infoUser = new PropertyInfo();
infoUser.setName("Username");
infoUser.setType(String.class);
infoUser.setValue(strings[0]);
request.addProperty(infoUser);
PropertyInfo infoPass = new PropertyInfo();
infoPass.setName("Password");
infoPass.setType(String.class);
infoPass.setValue(strings[1]);
request.addProperty(infoPass);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
try{
HttpTransportSE androidHTTPTransportSE = new HttpTransportSE(URL);
androidHTTPTransportSE.call(SOAP_ACTION_LOGIN,envelope);
//SoapObject result = (SoapObject) envelope.bodyIn;
if (envelope.bodyIn instanceof SoapFault) {
String str= ((SoapFault) envelope.bodyIn).faultstring;
Log.i("", str);
returnResult = null;
} else {
SoapObject result = (SoapObject) envelope.bodyIn;
returnResult = result.getProperty(0).toString();
Log.d("WS", String.valueOf(result));
}
}catch (Exception e){
e.printStackTrace();
returnResult = null;
return e.toString();
}
return returnResult;
}
protected void OnPostExecute(String result)
{
if(result.equals("true"))
{
Intent intent = new Intent(LoginActivity.this,MainActivity.class);
//intent.putExtra("GetUsername",userStr);
startActivity(intent);
}
else
{
Toast.makeText(LoginActivity.this,"Invalid Username/Password",Toast.LENGTH_LONG).show();
}
}
}