I'm creating an Android APP for college work, I'm using Android Studio and Eclipse Mars with Glassfish 4.
The webservice I believe to be okay, because realizing the requests by SoapUI everything works right, but at the time of consuming with Android Studio, the object that arrives at the server is Null.
Here is the code used for Android calling in Android Studio:
public boolean inserirUsuario(Cliente cliente){
SoapObject inserirUsuario = new SoapObject(NAMESPACE, INSERIR);
SoapObject user = new SoapObject(NAMESPACE, "cliente");
user.addProperty("id", cliente.getId());
user.addProperty("cpf", cliente.getCpf());
user.addProperty("primeiroNome", cliente.getPrimeiroNome());
user.addProperty("sobrenome", cliente.getSobrenome());
user.addProperty("email", cliente.getEmail());
user.addProperty("senha", cliente.getSenha());
user.addProperty("ddd", cliente.getDdd());
user.addProperty("telefone", cliente.getTelefone());
user.addProperty("ativo", cliente.isAtivo());
inserirUsuario.addSoapObject(user);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(inserirUsuario);
envelope.implicitTypes = true;
HttpTransportSE http = new HttpTransportSE(URL);
try {
http.call("\"urn:inserirUsuario\"", envelope);
SoapPrimitive resposta = (SoapPrimitive) envelope.getResponse();
return Boolean.parseBoolean(resposta.toString());
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
I have tried to get the "user" and only send the "insertUsuario", however of both manners the objects are arriving Null in the server.
Has anyone ever had a similar problem and can you help me with the solution?