Saltar para conteúdo


Foto
- - - - -

Erro org.xmlpull.v1.XmlPullParserException: expected: START_TAG

android ksoap soap java web service

  • Por favor inicie sessão para responder
1 resposta a este tópico

#1 rodrigo.oliveira

rodrigo.oliveira

    Novato

  • Membros
  • Pip
  • 1 mensagens

Mensagem publicada 08 November 2016 - 13:13

Pessoal, sou iniciante no desenvolvimento android e estou tendo um problema com web service soap. preciso enviar um objeto com os dados atualizados de um cliente. o que posso estar fazendo errado

 Segue xml da consulta

<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:atu="AtualizarCadastroClientes">
   <soapenv:Header/>
   <soapenv:Body>
      <atu:AtualizarCadastroClientes soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <Autenticacao xsi:type="urn:Autenticacao" xmlns:urn="urn:RouterBoxMobile">
            <ChaveIntegracao xsi:type="xsd:string"></ChaveIntegracao>
         </Autenticacao>
         <DadosAtualizadosClientes xsi:type="urn:DadosAtualizadosClientes" xmlns:urn="urn:RouterBoxMobile">
            <!--You may enter the following 12 items in any order-->
            <CodigoCliente xsi:type="xsd:int"></CodigoCliente>
            <Usuario xsi:type="xsd:string">?</Usuario>
            <Senha xsi:type="xsd:string">?</Senha>
            <!--Optional:-->
            <CEP xsi:type="xsd:string">?</CEP>
            <!--Optional:-->
            <Bairro xsi:type="xsd:string">?</Bairro>
            <!--Optional:-->
            <Endereco xsi:type="xsd:string">?</Endereco>
            <!--Optional:-->
            <Numero xsi:type="xsd:int">?</Numero>
            <!--Optional:-->
            <Complemento xsi:type="xsd:string">?</Complemento>
            <!--Optional:-->
            <TelComercial xsi:type="xsd:string">?</TelComercial>
            <!--Optional:-->
            <TelResidencial xsi:type="xsd:string">?</TelResidencial>
            <!--Optional:-->
            <TelCelular xsi:type="xsd:string">?</TelCelular>
            <Email xsi:type="xsd:string">?</Email>
         </DadosAtualizadosClientes>
      </atu:AtualizarCadastroClientes>
   </soapenv:Body>
</soapenv:Envelope>

Codigo onde chamo o metodo do web service

public String atuzalizarCadastroCliente(DadosCadastraisSeralizable dados) throws IOException, XmlPullParserException {
SoapObject request = new SoapObject("urn:RouterBoxMobile", "AtualizarCadastroClientes");



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

request.addProperty("Autenticacao",chaveIntegracao);
request.addProperty("DadosAtualizadosClientes",dados);




MarshalDouble m = new MarshalDouble();

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.implicitTypes=true;
envelope.encodingStyle = SoapSerializationEnvelope.XSD;
m.register(envelope);
envelope.setOutputSoapObject(request);






HttpTransportSE httpTransportSE = new HttpTransportSE(URL_WEBSERVICE);
httpTransportSE.debug=true;

httpTransportSE.call("",envelope);
test=httpTransportSE.requestDump.toString();

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

return response.toString();


}

e minha classe dados serealizada

package routerbox.com.br.centraisdoassinante.routerbox.com.br.centraisdoassinante.models;

import org.ksoap2.serialization.KvmSerializable;
import org.ksoap2.serialization.PropertyInfo;

import java.util.Hashtable;

/**
* Created by rodrigo on 04/11/16.
*/

public class DadosCadastraisSeralizable implements KvmSerializable{

public String codigo;
public String usuario;
public String senha;
public String cep;
public String bairro;
public String endereco;
public String numero;
public String complemento;
public String foneComercial;
public String foneResidencial;
public String foneCelular;
public String email;




@Override
public Object getProperty(int i) {
switch (i){
case 0:
return this.codigo;
case 1:
return this.usuario;
case 2:
return this.senha;
case 3:
return this.cep;
case 4:
return this.bairro;
case 5:
return this.endereco;
case 6:
return this.numero;
case 7:
return this.complemento;
case 8:
return this.foneComercial;
case 9:
return this.foneResidencial;
case 10:
return this.foneCelular;
case 11:
return this.email;

}


return null;
}

@Override
public int getPropertyCount() {
return 12;
}

@Override
public void setProperty(int i, Object o) {
switch (i){
case 0:
this.codigo= o.toString();
break;
case 1:
this.usuario=o.toString();
break;
case 2:
this.senha=o.toString();
break;
case 3:
this.cep=o.toString();
break;
case 4:
this.bairro=o.toString();
break;
case 5:
this.endereco= o.toString();
break;
case 6:
this.numero= o.toString();
break;
case 7:
this.complemento= o.toString();
break;
case 8:
this.foneComercial= o.toString();
break;
case 9:
this.foneResidencial=o.toString();
break;
case 10:
this.foneCelular=o.toString();
break;
case 11:
this.email=o.toString();
break;
}
}

@Override
public void getPropertyInfo(int i, Hashtable hashtable, PropertyInfo propertyInfo) {
switch (i){
case 0:
propertyInfo.type=PropertyInfo.INTEGER_CLASS;
propertyInfo.name="CodigoCliente";
break;
case 1:
propertyInfo.type=PropertyInfo.STRING_CLASS;
propertyInfo.name="Usuario";
break;
case 2:
propertyInfo.type=PropertyInfo.STRING_CLASS;
propertyInfo.name="Senha";
break;
case 3:
propertyInfo.type=PropertyInfo.STRING_CLASS;
propertyInfo.name="CEP";
break;
case 4:
propertyInfo.type=PropertyInfo.STRING_CLASS;
propertyInfo.name="Bairro";
break;
case 5:
propertyInfo.type=PropertyInfo.STRING_CLASS;
propertyInfo.name="Endereco";
break;
case 6:
propertyInfo.type= PropertyInfo.STRING_CLASS;
propertyInfo.name="Numero";
break;
case 7:
propertyInfo.type=PropertyInfo.STRING_CLASS;
propertyInfo.name="Complemento";
break;
case 8:
propertyInfo.type=PropertyInfo.STRING_CLASS;
propertyInfo.name="TelComercial";
break;
case 9:
propertyInfo.type=PropertyInfo.STRING_CLASS;
propertyInfo.name="TelResidencial";
break;
case 10:
propertyInfo.type=PropertyInfo.STRING_CLASS;
propertyInfo.name="TelCelular";
break;
case 11:
propertyInfo.type=PropertyInfo.STRING_CLASS;
propertyInfo.name="Email";
}

}
}




  • AustAdmilk, Franwab e StepRatte gosta disto

#2 xanex

xanex

    Membro

  • Membros
  • PipPip
  • 199 mensagens
  • LocalizaçãoLisboa
  • Nexus 10, Nexus 5x, Nexus 6p

Mensagem publicada 21 November 2016 - 14:27

tens ai muito texto para ler :P

 

ja viste pelo stackoverflow se ha alguma coisa?

tipo este
http://stackoverflow...start-tag-error







Também marcado com uma ou mais destas tags: android, ksoap, soap, java, web service