I have this method:
public String comprovarLogin(String usuari, String contrasenya){
final String metode = "comprovarLogin";
String ret = null;
try{
//Preparem els arguments del mètode compovarLogin
Map<String,String> args = new HashMap<>();
args.put("usuari",usuari);
args.put("contrasenya",contrasenya);
//Fem la crida al mètode per obtenir-ne la resposta
SoapObject respostaSoap = usarWebService(metode,args);
//Retornem el valor de "authId"
System.out.println(respostaSoap.getPrimitiveProperty("authId"));
}
catch(Exception ex){
ex.printStackTrace();
ret = "ERROR_CRIDA";
}
return ret;
}
in the WbServiceCalls class
The issue is that from another class called Xxxxxxx
I do the following:
WebServiceCalls calls = new WebServiceCalls();
System.out.println(calls.comprovarLogin(usuari, usuariContrasenya));
I call the comprovarLogin method and I pass two values to it.
Up to here perfect. But I would be interested to be able to use the variable respostaSoap.getPrimiteProperty ("authId") of the class webserviceCalls to do things with it from class xxxxxxx.
How can I do it?
The idea is to make an if / else to verify that the authId value is for example the name "Dani".
Thanks.
PS: My idea would be to do something like this:
WebServiceCalls calls = new WebServiceCalls();
System.out.println(calls.comprovarLogin(usuari, usuariContrasenya));
//comprobar authId
if (Authid.equalsIgnoreCase("Dani"){
bla bla bla
{
}else{
bla bla
}