我正在制作一个 android 应用程序,并且需要访问一个基于 WSDL 的在线数据库。我的代码从该数据库访问国家/地区列表,但我不知道我会以什么格式获取数据。例如。一个字符串,一个数组?等等。那么 WSDL 是否有任何标准的返回类型?谢谢。
编辑:代码片段
//this is the actual part that will call the webservice
androidHttpTransport.call(SOAP_ACTION, envelope);
// Get the SoapResult from the envelope body.
SoapObject result = (SoapObject)envelope.bodyIn;
if(result!=null)
{
//put the value in an array
// prepare the list of all records
List<HashMap<String, String>> fillMaps = new ArrayList<HashMap<String, String>>();
for(int i = 0; i < 10; i++){
HashMap<String, String> map = new HashMap<String, String>();
map.put(result.getProperty(i).toString());
fillMaps.add(map);
lv.setOnItemClickListener(onListClick);
}
// fill in the grid_item layout
SimpleAdapter adapter = new SimpleAdapter(this, fillMaps, R.layout.grid_item, from, to);
lv.setAdapter(adapter);
}
else
{
Toast.makeText(getApplicationContext(), "No Response",Toast.LENGTH_LONG).show();
}
} catch (Exception e) {
e.printStackTrace();
}