Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/32.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android-如何在Android中将SoapPrimitive结果转换为字符串数组_Android_Asp.net_Arrays_Web Services_Ksoap2 - Fatal编程技术网

Android-如何在Android中将SoapPrimitive结果转换为字符串数组

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] = "

现在我想在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] = "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
}