TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mark Lynn
NA
2
1.4k
Returning JSON from C# Webservice WITHOUT the XML Tags
Mar 16 2016 1:06 PM
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
Reply
Answers (
1
)
HTTP Verbs clarification
Web Service Run on Localhost But not in IP Address