ktmedlin
asked on
Web service method return JSON text without XML tags
How can I create a webmethod in a web service that returns only text without the XML?
Here is my code:
public class Services : System.Web.Services.WebSer vice {
[WebMethod]
public string Sample() {
return "I want only text.";
}
Current Result:
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">I want only text.</string>
Desired Result:
"I want only text."
Thanks.
Here is my code:
public class Services : System.Web.Services.WebSer
[WebMethod]
public string Sample() {
return "I want only text.";
}
Current Result:
<?xml version="1.0" encoding="utf-8" ?>
<string xmlns="http://tempuri.org/">I want only text.</string>
Desired Result:
"I want only text."
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER