Last post Dec 08, 2013 09:49 PM by Steven Cheng - MSFT
Dec 08, 2013 03:41 AM|gj11944|LINK
I need to write web service that read data from the database and need to return it to android client... there will be about 1000 rows to be return in xml formatt .
what is the best way ?
Dec 08, 2013 03:46 AM|smirnov|LINK
The best way? The is only one way
1) create webservice
2) open connection to database and get data
3) return the required data
Dec 08, 2013 09:49 PM|Steven Cheng - MSFT|LINK
For retrieving data from from database, you can consider using ADO.NET Entity Framework (plus LINQ query) which is quite simple an straightforward.
After you get data loaded in your .NET runtime, you can consider building a RESTful webservice to expose the data (as XML or JSON format) to your mobile client (android, iOS or windows phone, etc..). To build a RESTful service with .NET, you can consider
using WCF REST service programming model:
#An Introduction To RESTful Services With WCF
#WCF Web HTTP Programming Model Overview
#Building and Testing WCF RESTful services
or ASP.NET has provided built-in support on building RESTful service via Web-API feature:
#Build RESTful API's with ASP.NET Web API
#JSON and XML Serialization in ASP.NET Web API