Android-如何在Android中将SoapPrimitive结果转换为字符串数组
现在我想在ANDROID JAVA的数组字符串中获取Android-如何在Android中将SoapPrimitive结果转换为字符串数组,android,asp.net,arrays,web-services,ksoap2,Android,Asp.net,Arrays,Web Services,Ksoap2,现在我想在ANDROID JAVA的数组字符串中获取SoapPrimitive的result变量。我试着用下面的方法来做,但是我收到了一个错误 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] = "
SoapPrimitive
的result
变量。我试着用下面的方法来做,但是我收到了一个错误
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
}
String数组_test=新字符串[2];
对于(int i=0;i,一旦您将SoapResult作为SoapPrimitive,您就必须按如下方式将其解组:
String array_test=new String [2];
for (int i=0;i<2;i++)
{
arraytest[i]=result[i]; // I am assigning the result to my string array
}
soapobjectobj=(SoapObject)SoapResult.getProperty(0);
//获取Soap结果的所有行
对于(int i=0;i
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
}