bom dia!
Estou com um pequeno problema:
A biblioteca ksoap está me retornando um erro ao tentar integrar com um webservice nusoap, sempre estou recebendo o retorno nulo, erro:
06-07 08:53:23.843 3039-3077/com.example.bomprato.bp E/ContentValues: Error: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference
Não sei se tem a ver com os parametros namespace, soap_action e method_name, que podem estar configurados incorretamente. Segue abaixo a minha configuração do ksoap com esses dados:
@Override
protected String doInBackground(Void... params) {
Log.i(TAG, "doInBackground");
System.out.println("INICIO##########################");
String SOAP_ACTION = "urn:BomPrato#listaIntro";
String METHOD_NAME = "Notificacoes.listaIntro";
String NAMESPACE = "urn:BomPrato";
String URL = "http://www.artistadaweb.com.br/ws/index.php";
SoapObject resposta = null;
InputStream resultado;
try {
SoapObject Request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = false;
envelope.setOutputSoapObject(Request);
HttpTransportSE ht = new HttpTransportSE(URL);
ht.debug = true;
System.out.println("aqui3");
ht.call(SOAP_ACTION, envelope);
System.out.println("aqui2");
resposta = (SoapObject) envelope.bodyIn;
System.out.println("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXaqui1");
// resposta.getProperty("item");
System.out.println("RESPOSTAAAAA: "+resposta.getProperty(0).toString());
} catch (Exception ex) {
Log.e(TAG, "Error: " + ex.getMessage());
}
return "fdsdsfds";
}
Segue o WS de testes que estou utilizando (apenas o metodo listaIntro que está operando por enquanto): http://www.artistadaweb.com.br/ws/index.php
Conto com a ajuda de vcs, valeu!