Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
Returning JSON from C# Webservice WITHOUT the XML Tags
Mark Lynn
Mar 16 2016 1:06 PM
595
Reply
Using this article as a basis, how does one omit the XML tags?
http://www.c-sharpcorner.com/UploadFile/8ef97c/web-service-in-Asp-Net-part-4/
First off, the article was well done; short, concise, clear, and simple.
Regarding my question, I've seen it asked many places, but no one seems to really have the answer. Though some are very impressive in their convolution.
This bit of code gets me really close:
HttpContext Context = HttpContext.Current;
Context.Response.ContentType = "application/json";
Context.Response.Write(list); // list here is a valid JSON object
Ideally, it seems I should be able to call the service via browser, and not get an error stating there was an XML parse record. However, I DO get that error.
Thanks
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
HTTP Verbs clarification
Web Service Run on Localhost But not in IP Address