Android的调用.NET Web服务Ksoap2 [英] Android calling .net webservice Ksoap2
本文介绍了Android的调用.NET Web服务Ksoap2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我打电话使用ksoap2在Android的一个.NET Web服务,我得到回应成才这样的
anyType的{NewDataSet = {anyType的字符串= 77777};
如何解析这个。请大家帮忙!
I am calling a .NET webservice using ksoap2 in android and i get a response someting like this
anyType{NewDataSet=anyType{string=77777};
how can i parse this. please help!
推荐答案
这是属性的多维数组,它是这样:
This is a multidimensional array of properties, it goes like :
anyType //property 0
{
NewDataSet=anyType // property 0 [0]
{
string=77777;
}
};
您可以手动解析它(这是用java code):
you can parse it manually (this is java code):
SoapObject yourResponseObject = (SoapObject) soapEnvelope.bodyIn;
SoapObject array = (SoapObject) yourResponseObject .getProperty(0);// this is -->anyType //property 0
SoapObject NewDataSetArray= (SoapObject)array .getProperty(0);// this is--> // property 0 [0]
//PropertyInfo propertyInfo = new PropertyInfo();
//NewDataSetArray.getPropertyInfo(0, propertyInfo);
String temp = null;
//if(propertyInfo.name.equalsIgnoreCase("NewDataset"))
//{
temp = NewDataSetArray.getProperty(0).toString();// this is 77777
//}
我没有测试它,但它应该工作,我猜你得到了点。
i did not test it, but it should work and i guess you got the point.
这篇关于Android的调用.NET Web服务Ksoap2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文