伙计我在android中使用soap web服务时遇到了麻烦,它给我发了这个错误
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>
有人可以帮助我吗?
答案 0 :(得分:0)
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);