pros and cons of AJAX compared to SOAP messaging

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Romeo85
    New Member
    • Mar 2008
    • 1

    pros and cons of AJAX compared to SOAP messaging

    I have started learning about Ajax and SOAP Messaging, can someone tell me what are pros and cons of AJAX compared to SOAP messaging
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #2
    hi ...

    this is quite a question :) ... SOAP is typically used to invoke webservices and as the name says it has a specific protocol with failure-states etc. while AJAX is used to make an 'ordinary' XMLHttpRequest that requests a resource at the server. even thogh you can send soap-messages through an XMLHttpRequest and invoke a webservice ... so the XMLHttpRequest is the transport object.

    SOAP is mainly XML you have an envelope and a body. so in short words ... using soap/xml adds some overhead to your webapp compared to a XMLHttpRequest that just transports json-data for example. but XML is a little bit more comfortable to use. webservices (typically) have a public description ... the WSDL-file that you may read and you know what params you have to send, what methods could be invoked and what response you might get ... while using the XMLHttpRequest method without such comfort you have to know! how the service is to be invoked and what you get ...

    hope this gets you on track with your further investigations on that interesting topic ... but there is much more to say as it could be done here :)

    kind regards

    Comment

    • Practicality
      New Member
      • Mar 2008
      • 2

      #3
      Since we are talking pros and cons, I would say this from my experience in dealing with Paypal SOAP as well as many different Ajax applications. With the caveat that this is my opinion.

      SOAP
      Pros:
      1. Generally more secure.
      2. Less likely to allow an incorrect transaction to pass through. (IE the data is validated in the process of the transaction)
      3. More structured, allowing you to control certain pieces of the transport of data.
      Cons:
      1. More complicated to understand.
      2. More difficult to implement (as there is much more to do).
      3. Not as well supported (SOAP didn't achieve the popularity that many thought it would, so you will have trouble finding companies that prefer this protocol).

      AJAX:
      Pros:
      1. Extremely flexible. Can handle whatever you want it to.
      2. Makes your application much more responsive and user-friendly.
      3. Easy to understand. There are some quirks that make it seem strange, but once you get the general idea it's a piece of cake.
      Cons:
      1. Security will take extra work. This a whole can of worms. You're opening up a whole new avenue to exploit. This may not be an issue depending upon what you expose, but you need to make sure you know it's secure before opening your database or other important information to Ajax calls.
      2. Increased development time over "traditiona l" methods. It will always take a little bit longer to make something in Ajax than just a post or something similar. Of course, you will tend to see a good ROI in that time as the application will be much easier to use.

      I don't know if the two things are really apples to apples, but that should give you enough information to have a better idea as to what kind of solution should work for you.

      Again, this is my opinion. Not all of these things are true in all cases (of course)!

      Comment

      Working...