0

I have a .net webservice that returns a string, I want the string representation returned bare and not wrapped up as xml. for example:

[WebMethod]
public string Enroll()
{
   return "You are welcome";
}

The response I get is:

<?xml version="1.0" encoding="utf-8" ?> 
  <string xmlns="http://somenamespace/">
   You are welcome
  </string> 

The response I prefer to get is simply:

You are welcome

How can I get this to happen without resorting to using a generic handler?

1 Answer 1

1

I don't think you can do this out of the box, since the idea of web services is to use the XML for interoperability and consistency. (eg a Windows OS web service can talk to a Linux web service and understand what was returned).

Have a look at this link.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.