我的网络服务:shreeomex.com/service.asmx
我无法在列表视图中显示它。谁能告诉我我做错了什么?
这是我的代码:
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
//this is the actual part that will call the webservice
androidHttpTransport.call(SOAP_ACTION1, envelope);
// Get the SoapResult from the envelope body.
SoapObject result = (SoapObject)envelope.getResponse();
result = (SoapObject) result.getProperty(1);
table = (SoapObject) result.getProperty(0);
tableRow = (SoapObject) table.getProperty(0);
if(result != null)
{
//Get the first property and change the label text
try {
SAXParserFactory saxparser = SAXParserFactory.newInstance();
SAXParser parser = saxparser.newSAXParser();
XMLReader xmlReader = parser.getXMLReader();
ParsingClass pc = new ParsingClass();
xmlReader.setContentHandler(pc);
String xml= result.toString(); ss.setText(xml);
StringReader sr = new StringReader(xml);
InputSource is = new InputSource(sr);
is.setEncoding("ISO-8859-1");
xmlReader.parse(is);
// InputStream is = getAssets().open("service.xml");
// xmlReader.parse(new InputSource(is));
BindingData bindingData = new BindingData(this, pc.CompanyId,
pc.CompanyName, pc.IsActive);
listView.setAdapter(bindingData);
} catch (Exception e) {
ss.setText(e.toString());
e.getMessage();
}
}
}