I'm unable to figure this out. My code is throwing this error
java.lang.ClassCastException: java.lang.String cannot be cast to java.util.Vector .WebService.parseJourney
public static ArrayList<Journey> parseJourney(Object response) {
ArrayList<Journey> rs = new ArrayList<Journey>();
try {
if (response == null) {
return rs;
}
@SuppressWarnings("unchecked")
Vector<Object> result = (Vector<Object>) response;
if (result.size() < 4) {
return rs;
}
Am sure have used generics with no issues in past.
Wow - that was quick. The call to parseJourney :
Vector<EntryValue> values = new Vector<EntryValue>();
EntryValue value = new EntryValue();
SoapObject request = new SoapObject(NAMESPACE_ENTRY, METHOD_NAME_ENTRY);
PropertyInfo pi = new PropertyInfo();
pi.setName("values");
pi.setValue(values);
pi.setType(MyArrayList.class);
request.addProperty(pi);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
SoapEnvelope.VER11);
envelope.setOutputSoapObject(request);
envelope.dotNet = true;
HttpTransportSE aht = new HttpTransportSE(URL_ENTRY);
try {
aht.call(SOAP_ACTION_ENTRY, envelope);
Object response = envelope.getResponse();
resultEntry = parseJourney(response);
return response.toString();
}
catch (Exception e) {
ERROR_EXCEPTION = 1;
return e.toString();
}
}
response
holds astring
, apparently... can you show the call toparseJourney
? – codeling Jul 16 '14 at 6:49String
to aVector
:Vector<Object> result = (Vector<Object>) response;
.response
is aString
(that's the compiler saying – Eypros Jul 16 '14 at 6:50parseJourney
is called. – Ted Hopp Jul 16 '14 at 6:50