Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 284
User Avatar asked May 06 '10 21:05

User


1 Answers

Look at using the [ScriptMethod] attribute.

like image 108
John Saunders Avatar answered Sep 22 '22 22:09

John Saunders