How to manipulate the returned object by envelope.getresponse()?

Asked

Viewed 47 times

2

I’m having difficulty to catch an object that resume my connection with the server, I log in and it returns me a getResponse.

  response = envelope.getResponse();

In this report comes the client code and code of the system permissions, how can I manipulate and save in separate attributes each of them? Permissions can be in a array.

  • I have solved the problem by following here. http://stackoverflow.com/questions/3038165/ksoap2-casting-getresponse

  • 1

    Rodrigo why not put an answer with the solution? It may in the future help others with the same problem.

  • 1

    @ramaral, I just posted the solution.

1 answer

1


Just follow my code.

public String loginCentral(LoginSerealizable login) throws IOException, XmlPullParserException {

        SoapObject request = new SoapObject("urn:RouterBoxMobile","LoginCentral");

        SoapObject chaveIntegracao = new SoapObject("urn:RouterBoxMobile","LoginCentral");
        chaveIntegracao.addProperty("ChaveIntegracao",chaveDeIntegracao);


        request.addProperty("Autenticacao",chaveIntegracao);
        request.addProperty("DadosLoginCentral",login);
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
        envelope.setOutputSoapObject(request);

        HttpTransportSE httpTransportSE = new HttpTransportSE(URL_WEBSERVICE);
        httpTransportSE.call("",envelope);

        SoapObject response =(SoapObject) envelope.bodyIn;
        this.codigoCliente = response.getProperty(0).toString();
        this.permissoes = response.getProperty(1).toString();


        return response.toString();
    }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.