Webservice or HttpHandler? Which one do you prefer?

  1. #1

    Webservice or HttpHandler? Which one do you prefer?

    What do you prefer to use when retrieving data from a simple Ajax request? Webservice (.asmx) or HttpHandler (.ashx)? What are the practical differences between the two? There are Coolite examples using both so not sure which one is the preferred method...
  2. #2

    RE: Webservice or HttpHandler? Which one do you prefer?

    To answer my own question: ASP.NET WebService sucks when dealing with json data. When doing an Ext.Ajax.request call, you have to use jsonData instead of params to send parameters. You have to unwrap the 'd' namespace from the response. You have to specify the contentType as application/json. With .ashx, you just do a normal request. Sooo much easier.

  3. #3

    RE: Webservice or HttpHandler? Which one do you prefer?

    C. AjaxMethods
  4. #4

    RE: Webservice or HttpHandler? Which one do you prefer?

    AjaxMethods is page specific I believe. When creating a reusable control, I find it more flexible if the control takes in an url that can point to a central ashx handler instead of rewriting it for every page that may use the control. If the AjaxMethod is not static/shared, it's actually slower than hitting a webservice/httphandler.

Similar Threads

  1. Replies: 0
    Last Post: Jun 03, 2012, 4:46 AM
  2. [CLOSED] Error when uploading file to httphandler
    By jchau in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Nov 09, 2011, 2:32 PM
  3. [CLOSED] [1.0]Question about httpHandler and DirectMethods
    By edigital in forum 1.x Legacy Premium Help
    Replies: 3
    Last Post: Nov 08, 2010, 8:11 PM
  4. [CLOSED] FileUploadField posting to a httphandler
    By jchau in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 13, 2010, 7:14 PM
  5. [CLOSED] LINQ + HttpHandler + GridPanel
    By Zarzand in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Apr 24, 2009, 7:52 PM

Posting Permissions