views:

32

answers:

2

what is different between ajax and webservices. Anybody provide with some examples?

+1  A: 

The term "Ajax" is generally used :

  • When the request is sent by a browser (client-side) to a server
  • When the transfered data is XML or JSON or HTML.


The word "webservice" is generally used :

  • When the request is sent by a server to another server, without a browser being involved
  • When the transfered data is SOAP -- at least when it's a SOAP webservice ^^ (Opposed to REST, for instance, which generally doesn't imply SOAP)


But I'd say that Ajax is basically some specific kind of webservice.

Pascal MARTIN
"Ajax is a kind of webservice"? I really disagree with that; it makes no sense to me. Ajax is an *action*, Webservice is an API running on a server available for calling. You can't compare them.
Noon Silk
Using an Ajax request to get some data, a request is sent, via the network, some action is done on the server, some data is returned and processed ; kinda fits in the "generalistic" webservice description, in my opinion
Pascal MARTIN
You're referring to the process of making a "webservice *call*". Obviously making a "webservice call" from a browser effectively means "Ajax". But a "webservice" does not relate to a "Ajax". What is "a Ajax"? It's nonsense.
Noon Silk
A: 

It's nonsensical to compare these things.

"Ajax" is a process that occurs in the browser. It is the act of calling some local server-side page, without refreshing the "main" viewing area, and then doing various things with that result (grabbing the data, making changes, changing the existing DOM (adding elements), whatever).

Webservices are a Serverside-thing that allows you to call methods, in your code, but have that call actually go to a remote machine. The call to the Webservice is generally also made server-side.

Noon Silk