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

2

I'm having trouble catching an object that I retune from my connection to the server, I log in and it returns me a getResponse .

  response = envelope.getResponse();

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

    
asked by anonymous 26.10.2016 / 12:21

1 answer

1

Here's how my code stayed.

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();
    }
    
26.10.2016 / 12:46