Click here to Skip to main content
15,891,688 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to create WebService For Android that give Response in Json.
Example Response like That:

{"StatusInfo":{"Status":"FAILED","StatusDescription":"Error Occurred","ErrorCode":"","ErrorMessage":"","Validation":null},"DataSet":["Name":"Will","SanName":"Simth"],["Name":"Jony","SanName":"Dep"]}


give me Example code for that , because i am new in asp.net.
Posted

As said before, I'll say again. We are not here to provide you with code, as we are not here to do your work for you. Refer first to the two FAQ's people should read first before posting questions: CP Q&A FAQ[^] and Pete O'Hanlon's[^] FAQ. We like to help, but we want to see at least a bit of effort on your part first.

As for your question, you create a WebService as you would normally create one, then you call it from Android as you normally call an URL, and consume the response. It's not that hard, once you put yourself to it.
 
Share this answer
 
Comments
Rajesh Sanandiya 7-Sep-12 7:33am    
sorry....i was not read CP Q&AFSQ
Andrei Straut 7-Sep-12 7:36am    
I will cut you some slack for that and not downvote your question.

After doing more research on the subject and trying to solve it yourself, you're more than welcome to return and describe the problems you ran into. If it is indeed a problem and it's properly asked, it's highly likely someone will try to help
You can google to find out several articles,on how to create web service.
Now specific to your question, your output should return JSON

To return a JSON string, you need to use in web method attribute
ResponseFormat = System.Web.Script.Services.ResponseFormat.Json

This will return JSON string.

Hope this helps.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900