How do I return pure XML from asmx web service?
问题 I want an asmx webservice with a method GetPeople() that returns the following XML (NOT a SOAP response): <People> <Person> <FirstName>Sara</FirstName> <LastName>Smith</LastName> </Person> <Person> <FirstName>Bill</FirstName> <LastName>Wilson</LastName> </Person> </People> How can I do this? 回答1: Look at using the [ScriptMethod] attribute. 回答2: If you don't want the Response to be in a SOAP envelope, are you also not bothered about calling the web service using SOAP. e.g. you are not creating