Sunday, March 2, 2014

VECTOR ANDROID read errors,


WEBSERVICE:
public Vector getUserInfo () {
DBConn db = new DBConn ();
ResultSet re = db.excecQuery ("select top 10 user_id, user_cname from sys_user");
List ltobject = new ArrayList ();
System.out.println ("DOC-> output started!");
Vector v = new Vector ();
try {
while (re.next ()) {
Users u = new Users ();
System.out.println (re.getString (1));
System.out.println (re.getString (2));
u.setUserid (re.getString (1));
u.setUserName (re.getString (2));
ltobject.add (u);
/ / Ltobject
}
v.addAll (ltobject);
return v;

} Catch (Exception e) {
e.printStackTrace ();
return null;
}

}

andriod:
Vector result = (Vector ) envelope.getResponse ();
One being given to this,
java.lang.classcastexception: org.ksoap2.serialization.soapobject
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
(Vector ) envelope.getResponse ();
Cast the wrong class object getResponse not return Vector
Reply:
KSOAP2 upgrade to 3.0 will be, not the original 2.4, but 3.0 is no AndroidHttpTransport this class, and why

No comments:

Post a Comment