Ajuda - ClassCastException KSOAP2 CONSUMINDO .NET

0 respostas
W

private static String urlServiceCenter=“http://localhost/WorkDeskServices/service.asmx”;
private static String URN=“http://tempuri.org/”;

public static boolean EntrarDia(String  usuario,String senha)  {
try{

String method=“Login”;

SoapObject soapO = new SoapObject(URN, method);

SoapSerializationEnvelope env = new SoapSerializationEnvelope(SoapEnvelope.VER11);

<a href="//env.encodingStyle">//env.encodingStyle</a> = SoapSerializationEnvelope.ENC;

// env.encodingStyle = SoapSerializationEnvelope.XSD;

soapO.addProperty(“usuario”,usuario);

soapO.addProperty(“senha”,senha);
OperacaoVO op=new OperacaoVO();

  env.addMapping(URN, "OperacaoVO", op.getClass());

  env.setOutputSoapObject(soapO);
 // env.bodyOut = soapO;
  env.dotNet=true;
  HttpTransport ht = new HttpTransport(urlServiceCenter);
  ht.debug=true;
  ht.call(URN + method, env);

  op= (OperacaoVO) env.getResponse();
}

catch (Exception e)

{

e.printStackTrace ();

System.out.println(e.toString());

}
}

CLASS KVM

public class OperacaoVO implements KvmSerializable {

public static final int STATUS = 0;
public static final int DESCRICAO = 1;

private boolean status;
private String descricao;

public boolean isStatus() {
    return status;
}
public void setStatus(boolean status) {
    this.status = status;
}
public String getDescricao() {
    return descricao;
}
public void setDescricao(String descricao) {
    this.descricao = descricao;
}

public Object getProperty(int index) {
    switch (index){
        case STATUS:
            return new Boolean(status);
        case DESCRICAO:
            return descricao;
      default:
            throw new RuntimeException("property not found "+ index);
    }

}

public int getPropertyCount() {
    return 2;
}

public void setProperty(int index, Object value){
    if (value== null || value.toString().equals("string{}"))
        return;
    switch (index){
        case STATUS:
            setStatus (((Boolean) value).booleanValue());;
            break;
        case DESCRICAO:
            setDescricao (value.toString());
            break;
        default:
            break;
    }
}


public void getPropertyInfo(int index, Hashtable properties, PropertyInfo info) {
    switch (index){
        case STATUS:
            info.name = "status";
            info.type = PropertyInfo.BOOLEAN_CLASS;
            break;
        case DESCRICAO:
            info.name = "descricao";
            info.type = PropertyInfo.STRING_CLASS;
            break;

        default:
            break;
    }
}

}

RETORNO XML

<?xml version="1.0" encoding="utf-8"?>true1

Alguem ai pode me ajudar?

Obrigado.

Criado 8 de agosto de 2009
Respostas 0
Participantes 1