9
如果我正在嘗試使用(String) response.getProperty(0);
檢索第一個數組,但它返回的是完整的字符串。如何從Android的KSOAP Web服務中檢索對象數組?
**Here is the code of webservice calling**
public static Object getResponse(String methodName, String actionName, LinkedHashMap<String, String> valueStrings)
{
SoapObject soapObject = new SoapObject(LetUsClickAPIConstants.COMMON_NAMESPACE, methodName);
Object response = null;
for (Map.Entry<String, String> mapKeys : valueStrings.entrySet())
{
soapObject.addProperty(mapKeys.getKey(), mapKeys.getValue());
}
final SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = false;
envelope.setOutputSoapObject(soapObject);
final AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(LetUsClickAPIConstants.COMMON_URL);
try
{
androidHttpTransport.call(actionName, envelope);
response = envelope.getResponse();
Log.d("Response ", response.toString());
} catch (final IOException e)
{
Log.d("Exception", "" + e);
} catch (final XmlPullParserException e)
{
Log.d("Exception", "" + e);
}
return response;
}
我在Vector類型的響應
[Client{UserId=93; nickName=ladies; }, Client{UserId=94; nickName=ABCD; }]
我已經嘗試了很多方法,但我不是成功以任何方式找回?