Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do we need web-services? How different is it from normal web-applications?

Just started with web-services so pardon me if my question sounds stupid.

Why do we need web-services? How are they different from normal web applications?

Two uses have been mentioned in many of the tutorials. One is the communication between different machines/applications, which sounds fine. But the next one is to develop reusable application components. My question is, do we need web services for that purpose?

For Eg: A Currency converter can be implemented as a web service and it can be published on a url. But then, the same can be created as a web-application. Where is the actual advantage of using web-services?

Also as per some posts in SO, webservices should be used if no UI is involved and web-applications if a gui is required. Is the choice all that simple?

Note: Here I'm referring to SOAP based web-service. RESTful ones might be different.

like image 325
Chillax Avatar asked Sep 04 '12 20:09

Chillax


People also ask

Why do we require web services?

Web services allow you to expose the functionality of your existing code over the network. Once it is exposed on the network, other applications can use the functionality of your program.

Is web application and web service same?

Web Application means for human beign can read. it is accessed through browsers. Web Services means for computers can read. it is accessed from any languages or platform.

What are the different applications that could use web services?

XML: It is a sample tag-based language that is used for describing information in a structured way. It also stores and transport data. SOAP: SOAP is a technology to support the exchange of XML-Coded messages over a transport protocol, such as HTTP and SMTP.


2 Answers

Web services (esp SOAP) are designed to be consumed / read / used by other programs. If you've ever had to write a "screen scrape" program (i.e., operate a web application and pick out the data you need from all the goo that makes the page pretty and friendly for the user) you'll appreciate the structure.

Also as per some posts in SO, webservices should be used if no UI is involved and web-applications if a gui is required. Is the choice all that simpe?

In a nutshell, "yes".

like image 147
Dan Pichelman Avatar answered Sep 22 '22 11:09

Dan Pichelman


There are many advantages of using web services. The main advantage over a regular http application is that it uses SOAP messaging which is much more efficient and less bandwidth costly.

Another advantage is that Service Transport, XML Messaging, Service Description and Service Discovery layers use a standard protocol which makes it easy for developers to develop functionality irrespective of programming languages.

Suppose you are a provider of a service, say weather forecast. Why make developers, go to your website, scrap your page and then extract the data that they need? Wouldn't it be easier to develop this by web service that a developer can pass in a date and get back a well defined xml document containing all the info they need? The same happens for all type of cases...

like image 23
MaVRoSCy Avatar answered Sep 24 '22 11:09

MaVRoSCy