I am making a method to update customer data, but when I go through this method I am having trouble sending the object, has anyone seen this problem?
Follow the code:
package routerbox.com.br.centraisdoassinante.routerbox.com.br.centraisdoassinante.models;
public class DadosCadastraisSeralizable implements KvmSerializable{
public int 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= Integer.parseInt(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";
}
}
}
This is the method in the webservice class:
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);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.implicitTypes=true;
httpTransportSE = new HttpTransportSE(URL_WEBSERVICE);
httpTransportSE.debug=true;
httpTransportSE.call("",envelope);
SoapObject response = (SoapObject) envelope.getResponse();
//resposta=envelope.getResponse();
return response.toString();
}
Error:
11-07 10:58:48.162 25214-25214/routerbox.com.br.centraisdoassinante W/EGL_genymotion: eglSurfaceAttrib not implemented
11-07 10:58:49.702 25214-25214/routerbox.com.br.centraisdoassinante W/EGL_genymotion: eglSurfaceAttrib not implemented
11-07 10:58:49.994 25214-25214/routerbox.com.br.centraisdoassinante W/EGL_genymotion: eglSurfaceAttrib not implemented
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope (position:START_TAG (empty) <br>@1:7 in java.io.InputStreamReader@52bfd5d4)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at org.kxml2.io.KXmlParser.require(KXmlParser.java:2046)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:127)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at org.ksoap2.transport.Transport.parseResponse(Transport.java:96)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:189)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:95)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at routerbox.com.br.centraisdoassinante.WebService.atuzalizarCadastroCliente(WebService.java:185)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at routerbox.com.br.centraisdoassinante.DadosCadastrais.onClick(DadosCadastrais.java:161)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at android.view.View.performClick(View.java:4240)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at android.view.View$PerformClick.run(View.java:17721)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at android.os.Handler.handleCallback(Handler.java:730)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at android.os.Handler.dispatchMessage(Handler.java:92)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at android.os.Looper.loop(Looper.java:137)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at android.app.ActivityThread.main(ActivityThread.java:5103)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at java.lang.reflect.Method.invokeNative(Native Method)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at java.lang.reflect.Method.invoke(Method.java:525)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-07 10:58:51.850 25214-25214/routerbox.com.br.centraisdoassinante W/System.err: at dalvik.system.NativeStart.main(Native Method)
This is the query 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: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>