0
I’m creating an Android APP for college work, I’m using Android Studio and Eclipse Mars with Glassfish 4.
The webservice I believe is okay, because performing the requests by Soapui everything works fine, but when consuming with Android Studio, the object that arrives on the server is Null.
Follow the code used for Android called 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 tried to take out the "user" and send only the "insert User", but both ways the objects are arriving Null on the server.
Someone once had a similar problem and can help me with the solution?