Difference asp.net web service and Ihttphandler
Asked Answered
I

1

5

Simple task like make AJAX request , pass one parameter and return result, can be done with Web Service and IHttpHandler, so where is the difference ?

Inhospitable answered 30/1, 2009 at 12:22 Comment(0)
I
10

ASP.NET web services are in fact a type of HttpHandler that provide an XML based communication infrastructure based on W3C standards (SOAP/WSDL). This means that non .NET clients can interoperate with ASP.NET web services. In your case where you're making a very simple single ajax request to return a simple result, ASP.NET/XML web services may be overkill.

It may be more beneficial/efficient to implement a simple custom HttpHandler rather than invoking all of the plumbing and overhead associated with ASP.NET web services. With a custom HttpHandler you can just send the parameter you need and return exactly the result you want to see without any of the supporting SOAP xml that would be created when using XML web services.

Indistinctive answered 30/1, 2009 at 12:45 Comment(2)
thanks Kev, now is more clear, with web services I can jump over a lot of work that has to be done if I use IHttpHandlerInhospitable
Also, if this is an AJAX service, you should look at using JSON instead of XML if possible, as it's much lighter weight than XML.Highstrung

© 2022 - 2024 — McMap. All rights reserved.