Android Complex Type ksop2

2

I've been working for days developing an application that consumes a Soap web service.  Sending a complex type I'm getting, how should I do to send more than one complex type?

The integration key I can send, but the ID, I can not get through, what can I do to get it right? Below is my code for how I am working.

SoapObject Autenticacao = new SoapObject("urn:RouterBoxMobile","ListaDetalhe");

SoapObject chaveIntegracao = new SoapObject("urn:RouterBoxMobile","ListaDetalhe");

chaveIntegracao.addProperty("ChaveIntegracao","########################");
Autenticacao.addSoapObject(chaveIntegracao);

SoapObject tlDadosTitulosDetalhe = new SoapObject("urn:RouterBoxMobile","ListaDetalhe");
SoapObject idTitulo = new SoapObject("urn:RouterBoxMobile","ListaDetalhe");
idTitulo.addProperty("ID_Titulo",@##);
tlDadosTitulosDetalhe.addSoapObject(idTitulo);


SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
        SoapEnvelope.VER11);


 envelope.setOutputSoapObject(Autenticacao);




Log.i("Testando web Service","");
String url="https://desenvtest.routerbox.com.br/routerbox/ws_teligo/rbx_server_mobile.php?wsdl";

HttpTransportSE httpTransport = new HttpTransportSE(url);
httpTransport.debug = true;




try {


    httpTransport.call("",envelope);

    SoapPrimitive msg = (SoapPrimitive)envelope.getResponse();

    Log.d("RouterBox", "Detalhes: " + msg);
} catch (IOException e) {
    e.printStackTrace();
} catch (XmlPullParserException e) {
    e.printStackTrace();
}

Follow xml

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:lis="ListaDetalhe">
   <soapenv:Header/>
   <soapenv:Body>
      <lis:ListaDetalhe soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <Autenticacao xsi:type="urn:Autenticacao" xmlns:urn="urn:RouterBoxMobile">
            <ChaveIntegracao xsi:type="xsd:string">?</ChaveIntegracao>
         </Autenticacao>
         <tlDadosTitulosDetalhe xsi:type="urn:tlDadosTitulosDetalhe" xmlns:urn="urn:RouterBoxMobile">
            <ID_Titulo xsi:type="xsd:int">?</ID_Titulo>
         </tlDadosTitulosDetalhe>
      </lis:ListaDetalhe>
   </soapenv:Body>
</soapenv:Envelope>
    
asked by anonymous 18.10.2016 / 14:25

1 answer

2

After much reading, I solved the problem. and I managed to pass more than one complex type.

Here is the code:

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


SoapObject chaveIntegracao = new SoapObject("urn:RouterBoxMobile","ListaDetalhe");

chaveIntegracao.addProperty("ChaveIntegracao","?");
request.addProperty("Autenticacao",chaveIntegracao);



SoapObject idTitulo = new SoapObject("urn:RouterBoxMobile","ListaDetalhe");

idTitulo.addProperty("ID_Titulo",1);


request.addProperty("tlDadosTitulosDetalhe",idTitulo);

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
        SoapEnvelope.VER11);




 envelope.setOutputSoapObject(request);
    
18.10.2016 / 15:56