Сложный тип Android Ksop2

#java #android #soap

#java #Android #soap

Вопрос:

ребята, у меня возникли проблемы с использованием веб-сервиса soap в Android, он возвращает мне эту ошибку

      HostConnection::get() New Host Connection established 0xed416aa0, tid 15486
10-17 09:32:18.066 15486-15519/routerbox.com.br.testwebservice W/System.err: SoapFault - faultcode: '97' faultstring: 'Chave de integração inválida.' faultactor: 'Erro de integração' detail: org.kxml2.kdom.Node@636fb25
10-17 09:32:18.066 15486-15519/routerbox.com.br.testwebservice W/System.err:     at org.ksoap2.serialization.SoapSerializationEnvelope.parseBody(SoapSerializationEnvelope.java:112)
10-17 09:32:18.066 15486-15519/routerbox.com.br.testwebservice W/System.err:     at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:137)
10-17 09:32:18.066 15486-15519/routerbox.com.br.testwebservice W/System.err:     at org.ksoap2.transport.Transport.parseResponse(Transport.java:63)
10-17 09:32:18.066 15486-15519/routerbox.com.br.testwebservice W/System.err:     at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:100)
10-17 09:32:18.066 15486-15519/routerbox.com.br.testwebservice W/System.err:     at routerbox.com.br.testwebservice.MainActivity.listaDetalhes(MainActivity.java:54)
10-17 09:32:18.066 15486-15519/routerbox.com.br.testwebservice W/System.err:     at routerbox.com.br.testwebservice.MainActivity.run(MainActivity.java:34)
10-17 09:32:18.066 15486-15519/routerbox.com.br.testwebservice W/System.err:     at java.lang.Thread.run(Thread.java:818)
 

это 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">1</ID_Titulo>
         </tlDadosTitulosDetalhe>
      </lis:ListaDetalhe>
   </soapenv:Body>
</soapenv:Envelope>
 

Кто-нибудь может мне помочь?

Ответ №1:

 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);