I’m a Android, Blackberry, windows mobile developer. I normally consume the API or the webservice which returns me the JSON. I was wondering how to create a web service which queries a DB(Like Mysql and returns me a JSON data) Is there a tutorial for doing so.
Which technology we can use for it? PHP, .Net or How to Create REST services or SOAP.
Normally i’m a user who consumes the API. I need to learn how the API was created.
Can you please help me guys.
You can use any web technology PHP, .Net, Java will all work. It can be rest or SOAP or non RESTful non SOAP plain JSON, XML or text. SOAP is pretty complicated to pull off on mobile devices though so I wouldn’t go that route.
So for example in PHP you would receive a HTTP request from the mobile device, the request can have parameters or not, this causes your PHP script to go off and pull some data from the DB and then return it as JSON, XML, text etc. Your mobile then takes this response and parses the info out of it, and does whatever it needs to do with the info.
You can take a look at some PHP rest frameworks
http://blog.programmableweb.com/2011/09/23/short-list-of-restful-api-frameworks-for-php/