ASP.NET WebService is Wrapping my JSON response with XML tags

In your code, don’t “return” the json. Use instead:

Context.Response.Write(ser.Serialize(jsonData));

Then you’ll be good.

The regular return command helps you by putting in a more proper service format. Some would say it’d be better form to use this, and unwrap your json on the client from this format. I say, just spit down the stuff exactly how you want to use it!

Leave a Comment