View Full Version : bind webservice to listview

07-04-2011, 06:49 AM

i am a beginner in android application development. I have developed a web service in dotnet. the methods of the webservice are returning dataset. I need a help to understand how do we bind a webservice to list view for android(Eclipse). im stuck please help. below is web method:

[WebMethod(Description = "the method fetches clean log for a customer")]
public DataSet FetchCleanLog(int CustomerID)
DataSet aDataSet = new DataSet();
CleanLogBL bl = new CleanLogBL(0);
bl.FetchAllForCustomer(aDataSet, CustomerID);
return aDataSet;

<DataSet xmlns="http://tempuri.org/">
<xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"id="NewDataSet">
<xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="tbCleanLog">
<xs:element name="CleanLog" type="xs:long" minOccurs="0"/>
<xs:element name="Customer" type="xs:long" minOccurs="0"/>
<xs:element name="Name" type="xs:string" minOccurs="0"/>
<xs:element name="Cleaned" type="xs:boolean" minOccurs="0"/>
<xs:element name="Color" type="xs:long" minOccurs="0"/>
<xs:element name="ColorName" type="xs:string" minOccurs="0"/>
<xs:element name="CleanDate" type="xs:string" minOccurs="0"/>
<xs:element name="CreatedBySystemUser" type="xs:long" minOccurs="0"/>
<xs:element name="CreatedOnDate" type="xs:string" minOccurs="0"/>
<xs:element name="ModifiedBySystemUser" type="xs:long" minOccurs="0"/>
<xs:element name="ModifiedOnDate" type="xs:string" minOccurs="0"/>








<diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
<NewDataSet xmlns="">
<tbCleanLog diffgr:id="tbCleanLog1" msdata:rowOrder="0">
<ColorName>Yellow Brava</ColorName>





07-04-2011, 08:04 PM
let me move this to the correct section for more help

07-08-2011, 07:28 PM
I dont use Webservices because... well... webservices.... I'll hold my toungue.

Anyways, Android doesnt have built in webservice <-> view binding. You'd have to bind it manually or try and find a library that helps you bind it.

For XML parsing I'd reccommend the DOM or SAX parser in the Android API, and for binding a data model to a Listview, you should look into creating an array of custom Java objects and extending the BaseAdapter interface. BaseAdapter will help you connect your data to the ListView.

Hope that helps.