我有一个返回List>的wcf ksoap2服务作为回应。现在我必须解析这个回复
anyType
{
ArrayOfstring=anyType
{
string=Wireless; string=Access Wireless; string=anyType{}; string=anyType{}; string=00001; string=--;
};
ArrayOfstring=anyType
{
string=Wireless; string=Airlink; string=anyType{}; string=anyType{}; string=00003; string=--;
};
ArrayOfstring=anyType
{
string=Long Distance; string=Nobel LD GOT Africa; string=anyType{}; string=anyType{}; string=NBLDAF; string=--;
};
ArrayOfstring=anyType
{
string=Long Distance; string=STI LD Smash; string=anyType{}; string=anyType{}; string=00028; string=--;
};
ArrayOfstring=anyType
{
string=International TopUp; string=Afghanistan Etisalat Top-Up $2-$75; string=Hussain; string=0345339; string=ETIAFG; string=--;
};
ArrayOfstring=anyType
{
string=International TopUp; string=Afghanistan Etisalat Top-Up $2-$75; string=Hussain; string=0345339; string=ETIAFG; string=--;
};
ArrayOfstring=anyType
{
string=International TopUp; string=Bolivia Viva Top-Up $5 - $75; string=Hussain; string=0345339; string=VIVABO; string=--;
};
ArrayOfstring=anyType
{
string=International TopUp; string=Bolivia Viva Top-Up $5 - $75; string=Hussain; string=0345339; string=VIVABO; string=--;
};
ArrayOfstring=anyType
{
string=International TopUp; string=Peru Movistar Top-Up $5 - $75; string=Hussain; string=0345339; string=anyType{}; string=--;
};
}
我知道如何解析返回List的响应。我正在使用此代码
HttpTransportSE htp = new HttpTransportSE(URL);
htp.call(SOAP_ACTION, soapEnvelop);
response = (SoapObject) soapEnvelop.getResponse();
if (response != null) {
if (response.getPropertyCount() > 0) {
InternationalTopup.arr_Items = new String[response
.getPropertyCount()];
for (int i = 0; i < response.getPropertyCount(); i++) {
InternationalTopup.arr_Items[i] = response.getProperty(
i).toString();
}
}
}
但我不知道如何解析上面的回复。 我必须使用Json吗? 请提供一些示例并分享您的经验。 任何帮助将不胜感激。感谢