1
I have the following code to consume one WebService
:
public List<Convenio_Conselho_Grid_BD> Pesquisar_Convenios(int pCodigo_Entidade) {
SoapObject request = new SoapObject(oFinanceiro.WSDL_TARGET_NAMESPACE, oFinanceiro.OPERATION_NAME);
PropertyInfo pi = new PropertyInfo();
pi.setName("pCodigo_Entidade");
pi.setValue(pCodigo_Entidade);
pi.setType(Integer.class);
request.addProperty(pi);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE httpTransport = new HttpTransportSE(oFinanceiro.SOAP_ADDRESS);
Object response = null;
try {
envelope.addMapping(oFinanceiro.WSDL_TARGET_NAMESPACE, "Convênio Conselho", Convenio_Conselho_Grid_BD.class);
httpTransport.call(oFinanceiro.SOAP_ACTION, envelope);
response = envelope.getResponse();
} catch (Exception exception) {
Log.d("Erro", exception.toString());
}
return (List<Convenio_Conselho_Grid_BD>) response;
}
But when it will return the object, it gives the following error:
java.lang.ClassCastException: org.ksoap2.serialization.SoapObject cannot be cast to java.util.List
I’ve tried a lot of casting and nothing works.
This type was created in the .net
and created the same type with the same properties in the project android