<p>Is it possible to create a REST web service using ASP.NET 2.0?  The articles and blog entries I am finding all seem to indicate that ASP.NET 3.5 with WCF is required to create REST web services with ASP.NET.</p>

<p>If it is possible to create REST web services in ASP.NET 2.0 can you provide an example.</p>

<p>Thanks!</p>

[{'answer_id': 40701, 'author': 'Joel Coehoorn', 'author_id': 3043, 'author_profile': 'https://Stackoverflow.com/users/3043', 'pm_score': 0, 'selected': False, 'text': "<p>I'm only just beginning to use them, but from what I've seen 2.0 pretty assumes SOAP.</p>\n"}, {'answer_id': 40726, 'author': 'Ubiguchi', 'author_id': 2562, 'author_profile': 'https://Stackoverflow.com/users/2562', 'pm_score': 1, 'selected': False, 'text': '<p>You can certainly create RESTful web services in ASP.NET 2.0, for <a href="http://blogs.msdn.com/dseven/archive/2007/02/10/boise-code-camp-enabling-rest-in-asp-net.aspx" rel="nofollow noreferrer">example</a>, but there are no high-level APIs to do all the donkey work for you, as provided by WCF in .NET 3.5.</p>\n'}, {'answer_id': 40728, 'author': 'Nathan Lee', 'author_id': 3453, 'author_profile': 'https://Stackoverflow.com/users/3453', 'pm_score': 4, 'selected': True, 'text': '<p>I have actually created a REST web service with asp.net 2.0. Its really no different than creating a web page.</p>\n\n<p>When I did it, I really didn\'t have much time to research how to do it with an asmx file so I did it in a standard aspx file. I know thier is extra overhead by doing it this way but as a first revision it was fine.</p>\n\n<pre><code>protected void PageLoad(object sender, EventArgs e)\n{\n    using (XmlWriter xm = XmlWriter.Create(Response.OutputStream, GetXmlSettings()))\n    {\n        //do your stuff\n        xm.Flush();\n    }\n}\n\n    /// &lt;summary&gt;\n    /// Create Xml Settings object to properly format the output of the xml doc.\n    /// &lt;/summary&gt;\n    private static XmlWriterSettings GetXmlSettings()\n    {\n        XmlWriterSettings xmlSettings = new XmlWriterSettings();\n        xmlSettings.Indent = true;\n        xmlSettings.IndentChars = " ";\n        return xmlSettings;\n    }\n</code></pre>\n\n<p>That should be enough to get you started, I will try and post more later.</p>\n\n<p>Also if you need basic authentication for your web service it can be done, but it needs to be done manually if you aren\'t using active directory.</p>\n'}, {'answer_id': 40731, 'author': 'Joel Coehoorn', 'author_id': 3043, 'author_profile': 'https://Stackoverflow.com/users/3043', 'pm_score': 1, 'selected': False, 'text': "<p>Well, of course you could always implement the spec yourself.  It's just that there's nothing built-in to support it.  If you use Nathan Lee's solution, do it as an http handler (.ashx) rather than an aspx.  You can just about copy/paste his code into a new handler file.</p>\n"}, {'answer_id': 40748, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 1, 'selected': False, 'text': '<p>You can do RESTful web services easily by implementing the spec using IHTTPHandlers.</p>\n'}, {'answer_id': 41151, 'author': 'jdiaz', 'author_id': 831, 'author_profile': 'https://Stackoverflow.com/users/831', 'pm_score': 2, 'selected': False, 'text': '<p>It is definitely possible to create RESTful web services using ASP.NET. If you are starting a new project I would definitely look into creating RESTful web services using WCF. The 3.5 .NET Framework allows you to specify RESTful endpoint along with a regular old SOAP endpoint and still deliver the same service.</p>\n\n<p>All you really have to do is enable an endpointbehavior that calls out <code>&lt;webHttp /&gt;</code></p>\n\n<p>Here is a good series on creating RESTful web services using WCF: </p>\n\n<p><a href="http://blogs.msdn.com/bags/archive/2008/08/05/rest-in-wcf-blog-series-index.aspx" rel="nofollow noreferrer">http://blogs.msdn.com/bags/archive/2008/08/05/rest-in-wcf-blog-series-index.aspx</a></p>\n'}, {'answer_id': 1545720, 'author': 'Piers', 'author_id': 187407, 'author_profile': 'https://Stackoverflow.com/users/187407', 'pm_score': 1, 'selected': False, 'text': '<p>Also check out using ASP.Net MVC. I\'ve written some articles on this at my blog:</p>\n\n<p><a href="http://shouldersofgiants.co.uk/Blog/" rel="nofollow noreferrer">http://shouldersofgiants.co.uk/Blog/</a></p>\n\n<p>Look for my Creating a RESTful Web Service Using ASP.Net MVC series</p>\n'}, {'answer_id': 11249993, 'author': 'user1186065', 'author_id': 1186065, 'author_profile': 'https://Stackoverflow.com/users/1186065', 'pm_score': 0, 'selected': False, 'text': '<p>You can create RESTful service using </p>\n\n<p>1) WCF REST service\n2) ASP.NET Web API</p>\n\n<p>If you all care about RESTful service, ASP.NET web api is that you should go with. But if you need service that supports both SOAP webservice and RESTful then WCF REST would be a good choice.  </p>\n\n<p>There are some articles that discuss about one versus another.  This <a href="http://patelshailesh.com/index.php/what-is-resful-service-and-designning-restful-service-using-asp-net" rel="nofollow">article</a> may be helpful. </p>\n'}]
['https://Stackoverflow.com/questions/40692', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3498/']