views:

33

answers:

1

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/"&gt;
   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  A: 

Hi there.

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.

Cheers. Jas.

Jason Evans