I have following method that returns a string array in asp.net Webservice
[WebMethod]
public String[] findfactors(int x)
{
String[] facts = new String[2];
facts[0] = "jhj";
facts[1] = "hgfh";
return facts; /// I am returning the string array from the asp.net web service
}
现在我想在ANDROID JAVA的数组字符串中获取result
的{{1}}变量。我尝试过以下方式,但收到错误
SoapPrimitive
答案 0 :(得分:0)
一旦你将SoapResult作为SoapPrimitive,你就必须解开它:
SoapObject obj =(SoapObject) SoapResult.getProperty(0);
//fetch all the row of the Soap result
for(int i=0; i<obj.getPropertyCount(); i++)
{
String string= obj.getProperty(i).toString();
//Do what you want
}